diff options
author | 2020-02-16 11:31:37 +0100 | |
---|---|---|
committer | 2020-02-16 11:31:37 +0100 | |
commit | 09cf0b7af306ba92d2ba930bd871ee9733f8a4b9 (patch) | |
tree | 1daa9a7ef28bce862daf50046ff8e2bc03b32908 /futures/src | |
parent | 75d8de93ae48277bdbcb0129241530632d13e850 (diff) | |
download | iced-09cf0b7af306ba92d2ba930bd871ee9733f8a4b9.tar.gz iced-09cf0b7af306ba92d2ba930bd871ee9733f8a4b9.tar.bz2 iced-09cf0b7af306ba92d2ba930bd871ee9733f8a4b9.zip |
Enter executor context only on `Recipe` creation
Diffstat (limited to 'futures/src')
-rw-r--r-- | futures/src/runtime.rs | 13 |
1 files changed, 10 insertions, 3 deletions
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<Hasher, Event, Message>, ) { - 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); } } |