Slow consumer state still seems off, this is a first step trying to improve.
Increased the default number of pending messages limit but kept bytes the same.
Also introduced a default ErrHandler that will print out to stderr in case none has been set.
Signed-off-by: Derek Collison <derek@nats.io>
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>