Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normally, nats.Connect() would fail if there is no server available when this call is executed. With this new option, if no connection can be made, this call will return no error and will trigger code similar to the reconnect code. Therefore, MaxReconnect and ReconnectWait options are used as if the library had been disconnected and is trying to reconnect. Note that subscription and publish calls will also behave as if the library was in reconnection mode, which means that the calls are buffered and produce no error until the reconnect buffer size is full. Obviously, since the connection is not connected, Flush or Request/Reply calls would timeout. If the ReconnectHandler is set, it will be invoked if the library connects asynchronously. Unrelated: fixed a test that had a t.skip()... Resolves #195 Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
- Loading branch information
Showing
4 changed files
with
314 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.