You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(iroh-net)!: add subscribe method to Discovery trait (#2656)
## Description
Adds a `subscribe` method to the `Discovery` trait that returns an
`Option<BoxStream>`. The `subscribe` method will send `DiscoveryItems`
each time the discovery service discovers a remote node.
The magicsock is now subscribed to the discovery service and updates the
internal address book each time it receives a `DiscoveryItem`. The
source is marked as `Source::Discovery{ service: String }` and the
`Instant` that the magicsock received the information.
Users can now filter their list of `RemoteInfo`s for sources.
## Breaking Changes
- struct `RemoteInfo` now has field `sources`, which is a `Vec` of
`(iroh::net::endpoint::Source, Duration)`. The `Source` is how we heard
about the remote, and the `Duration` is how long ago we heard about it.
The `sources` field is ordered from the first time we heard about the
remote node to the most recent time we learned about the remote node, in
this session.
## Change checklist
- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
---------
Co-authored-by: Kasey Huizinga <ramfox@Kaseys-MBP.lan>
Co-authored-by: Divma <26765164+divagant-martian@users.noreply.github.com>
Co-authored-by: Floris Bruynooghe <flub@n0.computer>
0 commit comments