summaryrefslogtreecommitdiffstats
path: root/futures
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-16 11:31:37 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-16 11:31:37 +0100
commit09cf0b7af306ba92d2ba930bd871ee9733f8a4b9 (patch)
tree1daa9a7ef28bce862daf50046ff8e2bc03b32908 /futures
parent75d8de93ae48277bdbcb0129241530632d13e850 (diff)
downloadiced-09cf0b7af306ba92d2ba930bd871ee9733f8a4b9.tar.gz
iced-09cf0b7af306ba92d2ba930bd871ee9733f8a4b9.tar.bz2
iced-09cf0b7af306ba92d2ba930bd871ee9733f8a4b9.zip
Enter executor context only on `Recipe` creation
Diffstat (limited to 'futures')
-rw-r--r--futures/src/runtime.rs13
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);
}
}