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:
parent
32f7ca261f
commit
d50ff9b5d9
5 changed files with 97 additions and 4 deletions
|
|
@ -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(|_| ());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue