pub struct ProjectionSubscription<E: Executor, P: Default + 'static> { /* private fields */ }Expand description
Builder for a subscription that keeps a Projection auto-updated.
Created via Projection::subscription. On each incoming event, the
subscription loads the affected aggregate id through the projection,
which in turn re-runs handlers and persists the snapshot.
Implementations§
Source§impl<E, P> ProjectionSubscription<E, P>
impl<E, P> ProjectionSubscription<E, P>
Sourcepub fn routing_key(self, v: impl Into<String>) -> Self
pub fn routing_key(self, v: impl Into<String>) -> Self
Filters events by routing key.
Overrides any executor-level default.
Sourcepub fn all(self) -> Self
pub fn all(self) -> Self
Processes all events regardless of routing key.
Overrides any executor-level default.
Sourcepub fn chunk_size(self, v: u16) -> Self
pub fn chunk_size(self, v: u16) -> Self
Sets the number of events to process per batch (default 300).
Sourcepub fn continue_on_error(self) -> Self
pub fn continue_on_error(self) -> Self
Allows the subscription to continue after handler failures.
Sourcepub async fn start(self, executor: &E) -> Result<Subscription>
pub async fn start(self, executor: &E) -> Result<Subscription>
Starts the subscription.
Returns a Subscription handle that can be used for graceful shutdown.
Auto Trait Implementations§
impl<E, P> !RefUnwindSafe for ProjectionSubscription<E, P>
impl<E, P> !UnwindSafe for ProjectionSubscription<E, P>
impl<E, P> Freeze for ProjectionSubscription<E, P>
impl<E, P> Send for ProjectionSubscription<E, P>
impl<E, P> Sync for ProjectionSubscription<E, P>
impl<E, P> Unpin for ProjectionSubscription<E, P>where
E: Unpin,
impl<E, P> UnsafeUnpin for ProjectionSubscription<E, P>
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