pub struct BusHandles<E: Clone + Send + 'static> { /* private fields */ }Expand description
Bus handles. Use BusHandles::publish to push events; call
BusHandles::subscribe to obtain a fresh receiver.
Implementations§
Source§impl<E: Clone + Send + 'static> BusHandles<E>
impl<E: Clone + Send + 'static> BusHandles<E>
Sourcepub fn publish(&self, event: E)
pub fn publish(&self, event: E)
Broadcast event to every live subscriber. Closed receivers
are pruned in-line. When the bus is configured with
cluster(), also forwards to remote nodes via
atomr_cluster_tools::ClusterPubSub.
Sourcepub fn subscribe(&self) -> UnboundedReceiver<E>
pub fn subscribe(&self) -> UnboundedReceiver<E>
Subscribe and receive a fresh channel. The returned
UnboundedReceiver is closed when the bus drops or the
receiver is dropped. Subscribers receive both locally-published
events and events forwarded from peer nodes (when
clustered).
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for BusHandles<E>
impl<E> !RefUnwindSafe for BusHandles<E>
impl<E> Send for BusHandles<E>
impl<E> Sync for BusHandles<E>
impl<E> Unpin for BusHandles<E>
impl<E> UnsafeUnpin for BusHandles<E>
impl<E> !UnwindSafe for BusHandles<E>
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