pub struct EventBus { /* private fields */ }Expand description
A cheap-to-clone handle to the shared broadcast channel used as an internal event bus between services.
Implementations§
Source§impl EventBus
impl EventBus
Sourcepub fn publish(&self, event: InternalEvent)
pub fn publish(&self, event: InternalEvent)
Publish an event to all current subscribers.
Silently drops the event if there are no active subscribers (the
broadcast channel returns SendError in that case, which we ignore).
Sourcepub fn subscribe(&self) -> Receiver<InternalEvent>
pub fn subscribe(&self) -> Receiver<InternalEvent>
Subscribe to the event stream. Each call returns an independent receiver that starts from the next event published after the call.
Sourcepub fn subscriber_count(&self) -> usize
pub fn subscriber_count(&self) -> usize
Number of currently subscribed receivers — surfaced by the
/_awsim/debug/objects diagnostic to detect leaked SSE
subscribers.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventBus
impl !RefUnwindSafe for EventBus
impl Send for EventBus
impl Sync for EventBus
impl Unpin for EventBus
impl UnsafeUnpin for EventBus
impl !UnwindSafe for EventBus
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