Added
- Added
pending_size
option on connect to set max internal pending size for flushing commands and aflush_timeout
option to control the maximum time to wait for a flush.
For example to set it to 2MB only which is the default:
nats.connect(pending_size=2*1024*1024)
And similar to the nats.go client, it can be disabled if set to be negative:
nats.connect(pending_size=-1)
When pending size is disabled, then any published message during a disconnection will result in a synchronous OutboundBufferLimitError
thrown when publishing.
To control the flushing there is a flush_timeout
option that can be passed on connect as well.
nats.connect(flush_timeout=10)
By default, there is no flush timeout (it is None
) so the client can wait indefinitely during a flush similar to nats.go (eventually the ping interval ought to unblock the flushing). These couple of changes also improve the publishing performance of the client, thanks to @charbonnierg for contributing to this issue.
- JetStream: Added NAK delay support (#268, thanks @databasedav for the contribution)
- Added custom inbox prefix option (https://github.com/nats-io/nats.py/pull/276/files thanks @YiuRULE for the contribution!)
Fixed
Changed
-
Changed
nc.flush()
to now throwFlushTimeoutError
instead which is a subtype ofTimeoutError
that it used be using for backwards compatibility. -
Changed EOF disconnections being reported as
StaleConnectionError
and they are instead aUnexpectedEOF
error.