File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
crates/apollo_network/src/discovery Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,30 @@ use tokio_retry::strategy::ExponentialBackoff;
4848use crate :: mixed_behaviour;
4949use crate :: mixed_behaviour:: BridgedBehaviour ;
5050
51- /// Discovery event type.
52- /// Discovery has no external events and outputs only events for other behaviours
51+ /// Events emitted by the discovery behavior to coordinate with other network behaviors.
52+ ///
53+ /// The discovery behavior doesn't emit external events directly but instead
54+ /// coordinates with other behaviors (like Kademlia) to implement the full
55+ /// discovery process.
5356#[ derive( Debug ) ]
5457pub enum ToOtherBehaviourEvent {
58+ /// Request a Kademlia query for the specified peer.
59+ ///
60+ /// This event is used to trigger Kademlia DHT queries to find peers
61+ /// or gather routing table information.
5562 RequestKadQuery ( PeerId ) ,
56- FoundListenAddresses { peer_id : PeerId , listen_addresses : Vec < Multiaddr > } ,
63+
64+ /// Discovered listen addresses for a peer.
65+ ///
66+ /// This event is emitted when the discovery process finds new listening
67+ /// addresses for a known peer, typically through the identify protocol
68+ /// or DHT queries.
69+ FoundListenAddresses {
70+ /// The peer whose addresses were discovered.
71+ peer_id : PeerId ,
72+ /// The discovered listening addresses.
73+ listen_addresses : Vec < Multiaddr > ,
74+ } ,
5775}
5876
5977/// Discovery behaviour that handles the bootstrapping and Kademlia requesting
You can’t perform that action at this time.
0 commit comments