[−][src]Trait reducer::SpawnDispatcher
Trait for types that can spawn Dispatcher
s as an asynchronous task (requires async
).
Required methods
fn spawn_dispatcher<D, A, E>(
&mut self,
dispatcher: D
) -> Result<(AsyncDispatcher<A, E>, RemoteHandle<D::Output>), SpawnError> where
D: Dispatcher<A, Output = Result<(), E>> + Sink<A, Error = E> + Send + 'static,
A: Send + 'static,
E: Send + 'static,
&mut self,
dispatcher: D
) -> Result<(AsyncDispatcher<A, E>, RemoteHandle<D::Output>), SpawnError> where
D: Dispatcher<A, Output = Result<(), E>> + Sink<A, Error = E> + Send + 'static,
A: Send + 'static,
E: Send + 'static,
Spawns a Dispatcher
as a task that will listen to actions dispatched through the
AsyncDispatcher
returned.
The task completes
- successfully if
AsyncDispatcher
(or the last of its clones) is dropped. - successfully if
RemoteHandle
is is dropped, unlessRemoteHandle::forget
is called. - with an error if
Dispatcher::dispatch
fails.- The error can be retrieved by polling
RemoteHandle
to completion.
- The error can be retrieved by polling
Implementors
impl<S: ?Sized> SpawnDispatcher for S where
S: Spawn,
[src]
S: Spawn,
fn spawn_dispatcher<D, A, E>(
&mut self,
dispatcher: D
) -> Result<(AsyncDispatcher<A, E>, RemoteHandle<D::Output>), SpawnError> where
D: Dispatcher<A, Output = Result<(), E>> + Sink<A, Error = E> + Send + 'static,
A: Send + 'static,
E: Send + 'static,
[src]
&mut self,
dispatcher: D
) -> Result<(AsyncDispatcher<A, E>, RemoteHandle<D::Output>), SpawnError> where
D: Dispatcher<A, Output = Result<(), E>> + Sink<A, Error = E> + Send + 'static,
A: Send + 'static,
E: Send + 'static,