[][src]Trait eventstore::types::SubscriptionConsumer

pub trait SubscriptionConsumer {
    fn when_event_appeared<E>(
        &mut self,
        _: &mut E,
        _: Box<ResolvedEvent>
    ) -> OnEventAppeared
    where
        E: SubscriptionEnv
; fn when_confirmed(
        &mut self,
        _id: Uuid,
        _last_commit_position: i64,
        _last_event_number: i64
    ) { ... }
fn when_dropped(&mut self) { ... } }

Represents the lifecycle of a subscription.

Required methods

fn when_event_appeared<E>(
    &mut self,
    _: &mut E,
    _: Box<ResolvedEvent>
) -> OnEventAppeared where
    E: SubscriptionEnv

Called when the subscription has received an event from the server.

Loading content...

Provided methods

fn when_confirmed(
    &mut self,
    _id: Uuid,
    _last_commit_position: i64,
    _last_event_number: i64
)

Called when the subscription has been confirmed by the server. Usually, it's the first out of all callbacks to be called.

  • Notes It's possible to have when_event_appeared called before when_confirmed for catchup subscriptions as catchup subscriptions mixes several operations at the same time.

fn when_dropped(&mut self)

Called when the subscrition has been dropped whether by the server or the user themself.

Loading content...

Implementors

Loading content...