From bbb036e304b36e8c8e5c98884f2d086535c1eff9 Mon Sep 17 00:00:00 2001 From: Andronik Ordian <write@reusable.software> Date: Sat, 28 Nov 2020 23:14:37 +0100 Subject: [PATCH] util: implement FusedStream for Jobs (#2031) --- polkadot/node/subsystem-util/src/lib.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/polkadot/node/subsystem-util/src/lib.rs b/polkadot/node/subsystem-util/src/lib.rs index 30cd1074633..2620a1f25e4 100644 --- a/polkadot/node/subsystem-util/src/lib.rs +++ b/polkadot/node/subsystem-util/src/lib.rs @@ -674,6 +674,17 @@ where } } +impl<Spawner, Job> stream::FusedStream for Jobs<Spawner, Job> +where + Spawner: SpawnNamed, + Job: JobTrait, +{ + fn is_terminated(&self) -> bool { + false + } +} + + /// A basic implementation of a subsystem. /// /// This struct is responsible for handling message traffic between @@ -762,7 +773,7 @@ where ).await { break }, - outgoing = jobs.next().fuse() => { + outgoing = jobs.next() => { if let Err(e) = Self::handle_from_job(outgoing, &mut ctx).await { tracing::warn!(err = ?e, "failed to handle command from job"); } -- GitLab