You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
server.Start() method documentation seems a bit misleading. Documentation indicates that calling the method would block, and thus should be called in a go proc. However, it seems that the current implementation does not block, and the common pattern is to call server.WaitForShutdown() to block|wait for the server to exit.
This is something that one runs into when trying to embed NATS server. Pretty trivial to figure out how to call the method, however, would be even faster if docs were better.
Current docs in server/server.go
// Start up the server, this will block.// Start via a Go routine if needed.func (s*Server) Start() {
s.Noticef("Starting nats-server")
...
Something like this might be better
// Start up the server, this will not block.//// WaitForShutdown can be used to block and wait for the server to shutdown if needed.func (s*Server) Start() {
s.Noticef("Starting nats-server")
...
The text was updated successfully, but these errors were encountered:
Hey,
server.Start() method documentation seems a bit misleading. Documentation indicates that calling the method would block, and thus should be called in a go proc. However, it seems that the current implementation does not block, and the common pattern is to call server.WaitForShutdown() to block|wait for the server to exit.
This is something that one runs into when trying to embed NATS server. Pretty trivial to figure out how to call the method, however, would be even faster if docs were better.
Current docs in server/server.go
Something like this might be better
The text was updated successfully, but these errors were encountered: