Enter executor context only on Recipe creation

This commit is contained in:
Héctor Ramón Jiménez 2020-02-16 11:31:37 +01:00
parent 75d8de93ae
commit 09cf0b7af3
2 changed files with 12 additions and 6 deletions

View file

@ -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);
}
}