pub struct Dispatcher { /* private fields */ }Expand description
Routes notifications to registered senders by channel name.
Implementations§
Source§impl Dispatcher
impl Dispatcher
pub fn new() -> Self
pub fn register(&mut self, sender: Arc<dyn Sender>) -> &mut Self
pub fn channels(&self) -> impl Iterator<Item = &str>
Sourcepub async fn dispatch(
&self,
channel: &str,
recipient: &str,
notif: &Notification,
) -> Result<(), NotifyError>
pub async fn dispatch( &self, channel: &str, recipient: &str, notif: &Notification, ) -> Result<(), NotifyError>
Dispatch to the sender registered under channel.
pub async fn drain( &self, outbox: &dyn DurableOutbox, worker_id: &str, lease_secs: i64, batch: usize, retry_delay_secs: i64, ) -> Result<usize, String>
Trait Implementations§
Source§impl Clone for Dispatcher
impl Clone for Dispatcher
Source§fn clone(&self) -> Dispatcher
fn clone(&self) -> Dispatcher
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for Dispatcher
impl Default for Dispatcher
Source§fn default() -> Dispatcher
fn default() -> Dispatcher
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Dispatcher
impl !UnwindSafe for Dispatcher
impl Freeze for Dispatcher
impl Send for Dispatcher
impl Sync for Dispatcher
impl Unpin for Dispatcher
impl UnsafeUnpin for Dispatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more