pub struct ProcessManagerRouter<S: Default + Send + Sync + 'static> { /* private fields */ }Expand description
Router for process manager components (events → commands + PM events, multi-domain).
Domains are registered via fluent .domain() calls.
Implementations§
Source§impl<S: Default + Send + Sync + 'static> ProcessManagerRouter<S>
impl<S: Default + Send + Sync + 'static> ProcessManagerRouter<S>
Sourcepub fn new<R>(
name: impl Into<String>,
pm_domain: impl Into<String>,
rebuild: R,
) -> Self
pub fn new<R>( name: impl Into<String>, pm_domain: impl Into<String>, rebuild: R, ) -> Self
Create a new process manager router.
Process managers correlate events across multiple domains and maintain
their own state. The pm_domain is used for storing PM state.
Sourcepub fn domain<H>(self, name: impl Into<String>, handler: H) -> Selfwhere
H: ProcessManagerDomainHandler<S> + 'static,
pub fn domain<H>(self, name: impl Into<String>, handler: H) -> Selfwhere
H: ProcessManagerDomainHandler<S> + 'static,
Register a domain handler.
Process managers can have multiple input domains.
Sourcepub fn subscriptions(&self) -> Vec<(String, Vec<String>)>
pub fn subscriptions(&self) -> Vec<(String, Vec<String>)>
Get subscriptions (domain + event types) for this PM.
Sourcepub fn rebuild_state(&self, events: &EventBook) -> S
pub fn rebuild_state(&self, events: &EventBook) -> S
Rebuild PM state from events.
Auto Trait Implementations§
impl<S> Freeze for ProcessManagerRouter<S>
impl<S> !RefUnwindSafe for ProcessManagerRouter<S>
impl<S> Send for ProcessManagerRouter<S>
impl<S> Sync for ProcessManagerRouter<S>
impl<S> Unpin for ProcessManagerRouter<S>
impl<S> UnsafeUnpin for ProcessManagerRouter<S>
impl<S> !UnwindSafe for ProcessManagerRouter<S>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request