Closed JKRhb closed 2 years ago
Totals | |
---|---|
Change from base Build 1427777898: | 0.9% |
Covered Lines: | 562 |
Relevant Lines: | 610 |
Ping @relu91 :)
I'm not coap expert but looking at the logic seems good. This should allow freeing all resources without waiting for responses :)
Thank you for the feedback! :) I added a last couple of changes to the method so that you can both provide an optional callback and listen for close
events. This way the API is more similar to the one the CoAP server provides. I think if @Apollon77 could also have a look on it then the PR should be able to be merged :)
Add that close before 1.0 or after? ;-)
BTW: LGTM
Add that close before 1.0 or after? ;-)
Hmm, good question ;) I think we could already integrate it in 1.0 if this would be fine for you, but we could also put it into a separate minor (or patch?) release if you prefer.
:-)
This PR adds a
close
method to theAgent
class that aborts all pending requests and resolves #312. To do so, a small bug is fixed in theabort
method where the_msgInFlight
hasn't been decremented when a request is cancelled.An additional test is added to assert that the new method works as expected.