-
When writing rust-libp2p/protocols/ping/src/lib.rs Lines 81 to 82 in 0b44564 rust-libp2p/protocols/ping/src/lib.rs Lines 151 to 157 in 0b44564 In the case of Now what I'm pondering on is why this 'works'. There is no waker registered in I have found some existing discussion on this here: #5147 (comment):
However, I can't really verify/understand this pattern in I assume technically the solution is to use a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It's because
Regarding the last part of queuing events outside of the Still, using a channel or simply storing the waker and waking it when a new event is queued is the safest variant. |
Beta Was this translation helpful? Give feedback.
It's because
poll_next
alwayscontinue
s from the top after any events in pool (e.g. new connection events) or events on established connections. And then all behaviors are polled again. Does that make sense?Regarding the last part of queuing events outside of the
NetworkBehavior
…