-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: return token when request is made, resolve token when request handling completes #916
base: main
Are you sure you want to change the base?
Conversation
publish
/subscribe
/unsubscribe
packets are acked
Pull Request Test Coverage Report for Build 11861258827Details
💛 - Coveralls |
Glad to see the progress here. Some of the things to discuss:
The output shows "RecvError"
In
after
|
Thanks for the review, two more things I have been thinking about with respect to the interface are as follows:
|
rumqttc/src/eventloop.rs
Outdated
@@ -75,11 +75,11 @@ pub struct EventLoop { | |||
/// Current state of the connection | |||
pub state: MqttState, | |||
/// Request stream | |||
requests_rx: Receiver<Request>, | |||
requests_rx: Receiver<(Request, Option<PromiseTx>)>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requests_rx: Receiver<(Request, Option<PromiseTx>)>, | |
requests_rx: Receiver<PendingRequest>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved in #917
rumqttc/src/eventloop.rs
Outdated
/// Pending packets from last session | ||
pub pending: VecDeque<Request>, | ||
pub pending: VecDeque<(Request, Option<PromiseTx>)>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change, note on release
For 1, that's great. That also helps on 2, before we decide to put more things in error cases, the pkid helps to extract the error packet from event loop events. |
publish
/subscribe
/unsubscribe
packets are acked
Thank you for the efforts, I'm also interested in using this once it's merged. |
Any way that one can help to get this merged? Thank you! |
just an heads up: this will be merged and released with rumqttc upcoming version by / in January! thank you so much for your patience and contribution 💯 |
Solves #805
Type of change
New feature, that notifies the requester when their requests are acknowledged by the broker(in the case of QoS 1/2 Publishes and Subscribe/Unsubscribe) or when they are written to TCP buffer(for all other requests).
BREAKING:
pending
definition changes fromVecDeque<Request>
toVecDeque<(Request, Option<PromiseTx>)>
.Checklist:
cargo fmt
CHANGELOG.md
if it's relevant to the users of the library. If it's not relevant mention why.