Trait yew_agent::Dispatched

source ·
pub trait Dispatched: 'static + Worker + Sized {
    fn dispatcher() -> Dispatcher<Self>;
}
Expand description

This trait allows the creation of a dispatcher to an existing worker that will not send replies when messages are sent.

Required Methods§

Creates a dispatcher to the worker that will not send messages back.

Note

Dispatchers don’t have HandlerIds and therefore Worker::handle will be supplied None for the id parameter, and connected and disconnected will not be called.

Important

Because the Workers using Context or Public reaches use the number of existing bridges to keep track of if the worker itself should exist, creating dispatchers will not guarantee that an Worker will exist to service requests sent from Dispatchers. You must keep at least one bridge around if you wish to use a dispatcher. If you are using workers in a write-only manner, then it is suggested that you create a bridge that handles no-op responses as high up in the component hierarchy as possible - oftentimes the root component for simplicity’s sake.

Implementors§