From 65a7de49b256428e94df7a9f7be87687e1d25d49 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Mon, 6 Jan 2020 14:08:02 +0100 Subject: [PATCH] Address review on stable-futures --- core/src/nodes/tasks/manager.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/nodes/tasks/manager.rs b/core/src/nodes/tasks/manager.rs index b17b1cf3..505e0ef8 100644 --- a/core/src/nodes/tasks/manager.rs +++ b/core/src/nodes/tasks/manager.rs @@ -67,7 +67,7 @@ pub struct Manager { /// `local_spawns` list instead. threads_pool: Option, - /// 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 + Send>>>, @@ -237,7 +237,12 @@ impl Manager { 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(_) => {}, } }