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(agent): add close
method
#317
Conversation
Pull Request Test Coverage Report for Build 1473967935
💛 - Coveralls |
Ping @relu91 :) |
c08521c
to
dc70ea7
Compare
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.
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 |
Add that close before 1.0 or after? ;-) |
BTW: LGTM |
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.