mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-02 06:02:20 +00:00
Address review on stable-futures
This commit is contained in:
parent
84ebd20d01
commit
65a7de49b2
@ -67,7 +67,7 @@ pub struct Manager<I, O, H, E, HE, T, C = PeerId> {
|
||||
/// `local_spawns` list instead.
|
||||
threads_pool: Option<ThreadPool>,
|
||||
|
||||
/// If no executor is available, we move tasks to this list, and futures are polled on the
|
||||
/// If no executor is available, we move tasks to this set, and futures are polled on the
|
||||
/// current thread instead.
|
||||
local_spawns: FuturesUnordered<Pin<Box<dyn Future<Output = ()> + Send>>>,
|
||||
|
||||
@ -237,7 +237,12 @@ impl<I, O, H, E, HE, T, C> Manager<I, O, H, E, HE, T, C> {
|
||||
let msg = ToTaskMessage::HandlerEvent(event.clone());
|
||||
match task.sender.start_send(msg) {
|
||||
Ok(()) => {},
|
||||
Err(ref err) if err.is_full() => {}, // TODO: somehow report to user?
|
||||
Err(ref err) if err.is_full() => {
|
||||
// Note that the user is expected to call `poll_ready_broadcast` beforehand,
|
||||
// which returns `Poll::Ready` only if the channel isn't full. Reaching this
|
||||
// path always indicates a mistake in the code.
|
||||
log::warn!("start_broadcast called while channel was full");
|
||||
},
|
||||
Err(_) => {},
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user