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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more