-
Notifications
You must be signed in to change notification settings - Fork 959
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add addresses field for closing listeners (#1485)
* Add addresses field for closing listeners Add an addresses field to the ListenersEvent and the ListenerClosed to hold the addresses of a listener that has just closed. When we return a ListenerClosed network event loop over the addresses and call inject_expired_listen_address on each one. Fixes: #1482 * Use Vec instead of SmallVec In order to not expose a third party dependency in our API use a `Vec` type for the addresses list instead of a `SmallVec`. * Do not clone for ListenersEvent::Closed We would like to avoid clones where possible for efficiency reasons. When returning a `ListenersEvent::Closed` we are already consuming the listener (by way of a pin projection). We can therefore use a consuming iterator instead of cloning. Use `drain(..).collect()` instead of clone to consume the addresses when returning a `ListenersEvent::Closed`. * Expire addresses before listener The listener and its addresses technically expire at the same time, but since here we have to pick an order, it makes more sense that the addresses expire first. Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
- Loading branch information
Showing
4 changed files
with
16 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters