Implement Runtime and Executor in iced_core

They can be leveraged by shells to easily execute commands
and track subscriptions.
This commit is contained in:
Héctor Ramón Jiménez 2020-01-19 09:06:48 +01:00
parent 32f7ca261f
commit d50ff9b5d9
5 changed files with 97 additions and 4 deletions

View file

@ -28,14 +28,14 @@ where
}
}
pub fn update<Message, S>(
pub fn update<Message, Receiver>(
&mut self,
subscription: Subscription<Hasher, Event, Message>,
sink: S,
receiver: Receiver,
) -> Vec<BoxFuture<'static, ()>>
where
Message: 'static + Send,
S: 'static
Receiver: 'static
+ Sink<Message, Error = core::convert::Infallible>
+ Unpin
+ Send
@ -72,7 +72,7 @@ where
let future = futures::future::select(
cancelled,
stream.map(Ok).forward(sink.clone()),
stream.map(Ok).forward(receiver.clone()),
)
.map(|_| ());