pub struct Projector<C, P>where
C: CanonicalStore,
P: ProjectionStore,{ /* private fields */ }Expand description
Projector: consumes events from canonical store and applies to projection
Implementations§
Source§impl<C, P> Projector<C, P>where
C: CanonicalStore,
P: ProjectionStore,
impl<C, P> Projector<C, P>where
C: CanonicalStore,
P: ProjectionStore,
pub fn new( canonical: Arc<C>, projection: Arc<P>, config: ProjectorConfig, ) -> Self
Sourcepub fn with_event_notify(self, notify: Arc<Notify>) -> Self
pub fn with_event_notify(self, notify: Arc<Notify>) -> Self
Attach an event notification handle for push-based projection.
When set, run_continuous() awaits this notification instead of
sleeping for poll_interval_ms when caught up, giving near-zero
latency event processing with zero idle CPU usage.
Sourcepub fn run_once(&self) -> Result<ProjectorStats>
pub fn run_once(&self) -> Result<ProjectorStats>
Run one iteration of the projector loop
Sourcepub async fn run_continuous(&self) -> Result<()>
pub async fn run_continuous(&self) -> Result<()>
Run the projector continuously until shutdown.
When an event_notify handle is set (via Self::with_event_notify),
the projector awaits the notification instead of polling, giving
near-zero-latency projection with zero CPU waste when idle.
Falls back to poll_interval_ms sleep if no notifier is present.
Auto Trait Implementations§
impl<C, P> Freeze for Projector<C, P>
impl<C, P> RefUnwindSafe for Projector<C, P>where
C: RefUnwindSafe,
P: RefUnwindSafe,
impl<C, P> Send for Projector<C, P>
impl<C, P> Sync for Projector<C, P>
impl<C, P> Unpin for Projector<C, P>
impl<C, P> UnwindSafe for Projector<C, P>where
C: RefUnwindSafe,
P: RefUnwindSafe,
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