nats-io / nats.rs

Rust client for NATS, the cloud native messaging system.
Apache License 2.0
980 stars 159 forks source link

Subscription capacity documentation or implementtion value is incorrect #1275

Closed nazar-pc closed 1 week ago

nazar-pc commented 3 weeks ago

Observed behavior

ConnectOptions::subscription_capacity documentation says "Default is set to 1024 messages buffer": https://github.com/nats-io/nats.rs/blob/f86dce921fad45ece9f06e9ddbf72a6ef085125a/async-nats/src/options.rs#L607-L625

However, the actual implementation is 1024*64 for some reason: https://github.com/nats-io/nats.rs/blob/f86dce921fad45ece9f06e9ddbf72a6ef085125a/async-nats/src/options.rs#L107

Expected behavior

Documentation and implementation must match

Server and client version

async-nats 0.35.1

Host environment

No response

Steps to reproduce

No response

Jarema commented 3 weeks ago

The capacity is bigger as that yields quite substantial boost in performance. 'are you interested in contributing the fix to the docs?