[−][src]Trait eventually::Subscription
A Subscription to an EventStream
which can be "checkpointed":
keeps a record of the latest message processed by itself using checkpoint
,
and can resume working from such message by using the resume
.
Associated Types
type SourceId: Eq
Type of the Source id, typically an AggregateId
.
type Event
Event type stored in the EventStore
, typically an Aggregate::Event
.
type Error
Possible errors returned when receiving events from the notification channel.
Required methods
fn resume(
&self
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Persisted<Self::SourceId, Self::Event>, Self::Error>> + Send>>, Self::Error>> + Send>>
&self
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Persisted<Self::SourceId, Self::Event>, Self::Error>> + Send>>, Self::Error>> + Send>>
Resumes the current state of a Subscription
by returning the EventStream
,
starting from the last event processed by the Subscription
.
fn checkpoint(
&self,
version: u32
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send>>
&self,
version: u32
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send>>
Saves the provided version (or sequence number) as the latest version processed.
Implementors
impl<Store, Subscriber> Subscription for Transient<Store, Subscriber> where
Store: EventStore + Send + Sync,
Subscriber: EventSubscriber<SourceId = <Store as EventStore>::SourceId, Event = <Store as EventStore>::Event> + Send + Sync,
<Store as EventStore>::SourceId: Send,
<Store as EventStore>::SourceId: Sync,
<Store as EventStore>::Event: Send,
<Store as EventStore>::Event: Sync,
<Store as EventStore>::Error: Error,
<Store as EventStore>::Error: Send,
<Store as EventStore>::Error: Sync,
<Store as EventStore>::Error: 'static,
<Subscriber as EventSubscriber>::Error: Error,
<Subscriber as EventSubscriber>::Error: Send,
<Subscriber as EventSubscriber>::Error: Sync,
<Subscriber as EventSubscriber>::Error: 'static,
[src]
Store: EventStore + Send + Sync,
Subscriber: EventSubscriber<SourceId = <Store as EventStore>::SourceId, Event = <Store as EventStore>::Event> + Send + Sync,
<Store as EventStore>::SourceId: Send,
<Store as EventStore>::SourceId: Sync,
<Store as EventStore>::Event: Send,
<Store as EventStore>::Event: Sync,
<Store as EventStore>::Error: Error,
<Store as EventStore>::Error: Send,
<Store as EventStore>::Error: Sync,
<Store as EventStore>::Error: 'static,
<Subscriber as EventSubscriber>::Error: Error,
<Subscriber as EventSubscriber>::Error: Send,
<Subscriber as EventSubscriber>::Error: Sync,
<Subscriber as EventSubscriber>::Error: 'static,
type SourceId = <Store as EventStore>::SourceId
type Event = <Store as EventStore>::Event
type Error = Error
fn resume(
&self
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Persisted<<Transient<Store, Subscriber> as Subscription>::SourceId, <Transient<Store, Subscriber> as Subscription>::Event>, <Transient<Store, Subscriber> as Subscription>::Error>> + Send>>, <Transient<Store, Subscriber> as Subscription>::Error>> + Send>>
[src]
&self
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Persisted<<Transient<Store, Subscriber> as Subscription>::SourceId, <Transient<Store, Subscriber> as Subscription>::Event>, <Transient<Store, Subscriber> as Subscription>::Error>> + Send>>, <Transient<Store, Subscriber> as Subscription>::Error>> + Send>>
fn checkpoint(
&self,
version: u32
) -> Pin<Box<dyn Future<Output = Result<(), <Transient<Store, Subscriber> as Subscription>::Error>> + Send>>
[src]
&self,
version: u32
) -> Pin<Box<dyn Future<Output = Result<(), <Transient<Store, Subscriber> as Subscription>::Error>> + Send>>