feat(rumqttc): add support for unbounded client#1047
Conversation
|
Hi @imjyotiraditya, and thanks for the PR. I do think the builder pattern might be better long term, though with just two options for now it's not that beneficial. As for the unbounded clients, any reason that setting a really high bound wouldn't cut it? |
|
Hi @thehouseisonfire, thanks for the review! On the builder pattern - agreed it's lightweight with just two options today, but it's On high bound vs unbounded - a few references worth noting:
Happy to simplify the API further if you have a preference on shape! |
|
Hi @thehouseisonfire, just checking in - happy to address any further feedback or simplify the API if needed! |
|
Hey @imjyotiraditya, Sorry for the delay — I was working on a larger feature in my fork at the same time. I ended up making unbounded clients opt-in with an That said, I did like the API shape from your PR. It has now been merged and is working in my fork of this crate, so feel free to take a look there and see whether it fits yours need. Longer term, I do think your API design is better than what the upstream crate currently exposes. |
Signed-off-by: Jyotiraditya Panda <jyotiraditya@aospa.co>
Type of change
Description
Add
ClientBuilderandAsyncClientBuilderfor both v4 and v5 clients.The channel is bounded by default using the capacity set in
MqttOptions,with opt-in unbounded channels via
.unbounded().Before
After
The existing
Client::newandAsyncClient::neware deprecated but not removed,so existing code continues to work without changes.
Checklist
cargo fmtCHANGELOG.md