Files
versitygw/s3api
Yevgeniy Miretskiy 8495cf42b6 s3api: add WithOnListen option for server readiness notification
WithOnListen registers a callback invoked once the server is bound and
ready to accept connections. It wraps fiber's existing OnListen hook,
which fires immediately before the first connection is served.

This allows callers to detect readiness deterministically rather than
relying on a fixed sleep or polling a health endpoint.

Example use in tests:

    ready := make(chan struct{})
    srv, _ := s3api.New(..., s3api.WithOnListen(func() { close(ready) }))
    go srv.ServeMultiPort([]string{addr})
    <-ready // blocks until the server is accepting connections
2026-06-05 07:24:33 -04:00
..
2026-05-06 23:43:10 +04:00
2026-05-06 23:43:10 +04:00