pub struct RealtimeBroadcastObserver { /* private fields */ }Expand description
Observer that forwards entity change events to the realtime delivery pipeline.
Create with RealtimeBroadcastObserver::new, wire the returned receiver into an
super::delivery::EventDeliveryPipeline, then call
on_mutation_complete from the
mutation path.
Implementations§
Source§impl RealtimeBroadcastObserver
impl RealtimeBroadcastObserver
Sourcepub fn new(capacity: usize) -> (Self, Receiver<EntityEvent>)
pub fn new(capacity: usize) -> (Self, Receiver<EntityEvent>)
Create a new observer and its corresponding event receiver.
The capacity controls how many events can be buffered before backpressure
causes events to be dropped. Pass the receiver to an
super::delivery::EventDeliveryPipeline.
Sourcepub fn on_mutation_complete(&self, event: EntityEvent)
pub fn on_mutation_complete(&self, event: EntityEvent)
Called when a mutation completes. Non-blocking.
Tries to enqueue the event on the delivery-pipeline channel. If the channel
is full (pipeline under backpressure), the event is dropped and
realtime_events_dropped_backpressure_total is incremented. This keeps the
mutation response path free from realtime delivery latency.
Sourcepub fn events_dropped_total(&self) -> u64
pub fn events_dropped_total(&self) -> u64
Total number of events dropped due to delivery-pipeline backpressure.
Used by metrics exporters and health checks.
Auto Trait Implementations§
impl !Freeze for RealtimeBroadcastObserver
impl RefUnwindSafe for RealtimeBroadcastObserver
impl Send for RealtimeBroadcastObserver
impl Sync for RealtimeBroadcastObserver
impl Unpin for RealtimeBroadcastObserver
impl UnsafeUnpin for RealtimeBroadcastObserver
impl UnwindSafe for RealtimeBroadcastObserver
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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>
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>
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