From 09cf0b7af306ba92d2ba930bd871ee9733f8a4b9 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 16 Feb 2020 11:31:37 +0100 Subject: Enter executor context only on `Recipe` creation --- futures/src/runtime.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'futures/src/runtime.rs') diff --git a/futures/src/runtime.rs b/futures/src/runtime.rs index ede529dc..d204670b 100644 --- a/futures/src/runtime.rs +++ b/futures/src/runtime.rs @@ -95,11 +95,18 @@ where &mut self, subscription: Subscription, ) { - let futures = - self.subscriptions.update(subscription, self.sender.clone()); + let Runtime { + executor, + subscriptions, + sender, + .. + } = self; + + let futures = executor + .enter(|| subscriptions.update(subscription, sender.clone())); for future in futures { - self.executor.spawn(future); + executor.spawn(future); } } -- cgit