Add ability to handle events that expect an ack#463
Add ability to handle events that expect an ack#463mendess wants to merge 2 commits into1c3t3a:mainfrom
Conversation
|
I didn't add any tests because I didn't have the time to do it yet. But I've tested locally with my usecase and it seems to work |
socketio/src/packet.rs
Outdated
| pub nsp: String, | ||
| pub data: Option<String>, | ||
| pub id: Option<i32>, | ||
| pub id: Option<AckId>, |
There was a problem hiding this comment.
While I'm generally a fan of wrapper types, it's not worth the breaking API change.
There was a problem hiding this comment.
the reason I put this in is just so you can't make a mistake when calling ack on the client. Since you're not supposed to care what the ack id is I think this is a good change and it's better to make this change sooner rather than later. If you still disagree I can drop it
There was a problem hiding this comment.
I agree it's a reasonable change, but it would need to be made (and merged) separately.
There was a problem hiding this comment.
I also agree that this is a reasonable change, but please factor It out in separate commit / PR. This breaks existing users that depend on an i32 in this place and we cannot just ignore that. That being said, thanks for spotting this appropriately :)
I could not figure out how to run the |
b5935fb to
034578f
Compare
agreed, that target is a little lacking. You need to start up the test containers beforehand as seen in the ci: https://github.com/1c3t3a/rust-socketio/blob/2ef32ecbe053d100e350c4d77a71dd1cab19471e/.github/workflows/test.yml#L36C11-L37C133, speaking of which I'll turn that on for you (it'll run on every push if you can't get it running locally) |
034578f to
a290bc2
Compare
a290bc2 to
e69af99
Compare
1c3t3a
left a comment
There was a problem hiding this comment.
First of all, sorry for the late response.
Thanks a lot for working on this, it generally LGTM!
Regarding the tests: It'd be great to have them and I improved the make test-all target in #477.
Would be amazing if you could add the tests and split the AckId change out, then we're ready to merge this!
e69af99 to
a4e5287
Compare
|
Wtf github? I didn't close this 🤔 maybe it got confused when I was syncing my fork |
55d1a0f to
8526e48
Compare
|
I have removed the ack id commit and will make a separate PR for it later. I've run the |
|
@1c3t3a I saw this in passing & it looks like a review would be appreciated |
This adds three new methods to the API surface
[Raw]Client::ack(AckId, D)ClientBuilder::on_with_ack(Event, callback)ClientBuilder::on_any_with_ack(Event, callback)using these it's possible to receive messages that require ack and acknowledge them
Fixes #461