pub struct SubscriptionPublisher { /* private fields */ }Expand description
Publisher half used by the event distributor (testkit / composition).
Implementations§
Source§impl SubscriptionPublisher
impl SubscriptionPublisher
Sourcepub fn channel(
subscriber_id: impl Into<String>,
capacity: usize,
) -> (Self, CanonicalEventSubscription)
pub fn channel( subscriber_id: impl Into<String>, capacity: usize, ) -> (Self, CanonicalEventSubscription)
Create a bounded subscription pair.
Sourcepub async fn publish(
&self,
event: InterpreterOutputEvent,
) -> Result<(), SendError<Result<DeliveredEvent, SubscriptionStatus>>>
pub async fn publish( &self, event: InterpreterOutputEvent, ) -> Result<(), SendError<Result<DeliveredEvent, SubscriptionStatus>>>
Publish one event with the next delivery sequence (lossless backpressure).
Sourcepub async fn signal_gap(
&self,
expected: u64,
observed: Option<u64>,
) -> Result<(), ()>
pub async fn signal_gap( &self, expected: u64, observed: Option<u64>, ) -> Result<(), ()>
Signal a gap (fail-closed for Loop).
Sourcepub async fn signal_lost(&self) -> Result<(), ()>
pub async fn signal_lost(&self) -> Result<(), ()>
Signal source lost.
Trait Implementations§
Source§impl Clone for SubscriptionPublisher
impl Clone for SubscriptionPublisher
Source§fn clone(&self) -> SubscriptionPublisher
fn clone(&self) -> SubscriptionPublisher
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 moreAuto Trait Implementations§
impl Freeze for SubscriptionPublisher
impl RefUnwindSafe for SubscriptionPublisher
impl Send for SubscriptionPublisher
impl Sync for SubscriptionPublisher
impl Unpin for SubscriptionPublisher
impl UnsafeUnpin for SubscriptionPublisher
impl UnwindSafe for SubscriptionPublisher
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