nats-io / nats.py

Python3 client for NATS
https://nats-io.github.io/nats.py/
Apache License 2.0
902 stars 193 forks source link

add ConnectOptions dataclass #610

Open swelborn opened 1 month ago

swelborn commented 1 month ago

To fix #600.

Let me know if this is an OK approach.

Docstring is incomplete, but not sure where you'd like to put that. I can also add/change some tests, but it would be great if you could point me in the right direction for where to add those (there are 4 test_client files...).

swelborn commented 1 month ago

I tried something out with merging. Let me know if this approach will work. It looks at the call signature on every connect() call, so that's not ideal but I don't imagine it would cost a significant performance hit.

caspervonb commented 1 month ago

I tried something out with merging. Let me know if this approach will work. It looks at the call signature on every connect() call, so that's not ideal but I don't imagine it would cost a significant performance hit.

Yeah not worried about connect having overhead. Mostly the hot paths (e.g io where we have to be particularly careful).