*: make IfWatcher::new synchronous#24
Merged
Merged
Conversation
mxinden
approved these changes
Aug 10, 2022
mxinden
left a comment
Member
There was a problem hiding this comment.
👍 Cool. This looks good to me.
Member
|
@elenaf9 could you resolve the merge conflicts? |
elenaf9
commented
Aug 10, 2022
|
|
||
| ### Changed | ||
| - Add `IfWatcher::poll_next`. Implement `Stream` instead of `Future` for `IfWatcher`. See [PR 23]. | ||
| - Make `IfWatcher::new` synchronous. See [PR 24]. |
Member
Author
There was a problem hiding this comment.
Not sure how to describe this better.
mxinden
approved these changes
Aug 10, 2022
|
|
||
| ### Changed | ||
| - Add `IfWatcher::poll_next`. Implement `Stream` instead of `Future` for `IfWatcher`. See [PR 23]. | ||
| - Make `IfWatcher::new` synchronous. See [PR 24]. |
Member
|
@elenaf9 should I cut a release already, or do you expect other changes in the near future? |
Member
Author
I am still looking into simplifying the |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make
IfWatcher::newsynchronous. The only reason why it is currently async is because thelinuximplementation executed aAddressGetRequestinnewto obtain the initial list of ip addresses. By chaining this stream together with the existing message stream we can makelinux::IfWatcher::newsync and instead move the polling into theStreamimpl.Motivation for this change is that
IfWatcher::newbeing async currently causes some complexity in rust-libp2p. Concretely, it forces to wrap theIfWatcherin an enum [1] and first poll the future returned byIfWatcher::new[2] before we can poll theIfWatcheritself.