rust-socketio icon indicating copy to clipboard operation
rust-socketio copied to clipboard

Add ability to handle events that expect an ack

Open mendess opened this issue 1 year ago • 6 comments

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

mendess avatar Sep 16 '24 21:09 mendess

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

mendess avatar Sep 16 '24 21:09 mendess

suggestion: add tests so the feature continues to be tested and working

I could not figure out how to run the test-all recipe of the makefile, hence I didn't write any tests. I think docs could be improved on this in a later PR. For now can you tell me how I can run the tests?

mendess avatar Oct 16 '24 19:10 mendess

suggestion: add tests so the feature continues to be tested and working

I could not figure out how to run the test-all recipe of the makefile, hence I didn't write any tests. I think docs could be improved on this in a later PR. For now can you tell me how I can run the tests?

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)

ctrlaltf24 avatar Oct 16 '24 20:10 ctrlaltf24

Wtf github? I didn't close this :thinking: maybe it got confused when I was syncing my fork

mendess avatar Nov 24 '24 14:11 mendess

I have removed the ack id commit and will make a separate PR for it later. I've run the test-all tests locally and it all passes. I also made a small modification to the makefile so that I could run the tests multiple times

mendess avatar Nov 24 '24 15:11 mendess

@1c3t3a I saw this in passing & it looks like a review would be appreciated

ewancg avatar Apr 23 '25 16:04 ewancg