Struct wadm::workers::EventWorker
source · pub struct EventWorker<StateStore, C: Clone, P: Clone> { /* private fields */ }Implementations§
source§impl<StateStore, C, P> EventWorker<StateStore, C, P>where
StateStore: Store + Send + Sync + Clone + 'static,
C: ClaimsSource + InventorySource + LinkSource + Clone + Send + Sync + 'static,
P: Publisher + Clone + Send + Sync + 'static,
impl<StateStore, C, P> EventWorker<StateStore, C, P>where
StateStore: Store + Send + Sync + Clone + 'static,
C: ClaimsSource + InventorySource + LinkSource + Clone + Send + Sync + 'static,
P: Publisher + Clone + Send + Sync + 'static,
sourcepub fn new(
store: StateStore,
ctl_client: C,
command_publisher: CommandPublisher<P>,
status_publisher: StatusPublisher<P>,
manager: ScalerManager<StateStore, P, C>
) -> EventWorker<StateStore, C, P>
pub fn new( store: StateStore, ctl_client: C, command_publisher: CommandPublisher<P>, status_publisher: StatusPublisher<P>, manager: ScalerManager<StateStore, P, C> ) -> EventWorker<StateStore, C, P>
Creates a new event worker configured to use the given store and control interface client for fetching state
Trait Implementations§
source§impl<StateStore, C, P> Worker for EventWorker<StateStore, C, P>where
StateStore: Store + Send + Sync + Clone + 'static,
C: ClaimsSource + InventorySource + LinkSource + Clone + Send + Sync + 'static,
P: Publisher + Clone + Send + Sync + 'static,
impl<StateStore, C, P> Worker for EventWorker<StateStore, C, P>where
StateStore: Store + Send + Sync + Clone + 'static,
C: ClaimsSource + InventorySource + LinkSource + Clone + Send + Sync + 'static,
P: Publisher + Clone + Send + Sync + 'static,
source§fn do_work<'life0, 'async_trait>(
&'life0 self,
message: ScopedMessage<Self::Message>
) -> Pin<Box<dyn Future<Output = WorkResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn do_work<'life0, 'async_trait>(
&'life0 self,
message: ScopedMessage<Self::Message>
) -> Pin<Box<dyn Future<Output = WorkResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process the given work to completion. Almost all errors returned are things that could be
retried. But if for some reason a fatal error occurs, return
WorkError::Fatal to indicate
that work should stop. Any worker MUST handle acking the message (or passing it to another
worker). By default, when a ScopedMessage is dropped, it will nack itAuto Trait Implementations§
impl<StateStore, C, P> !RefUnwindSafe for EventWorker<StateStore, C, P>
impl<StateStore, C, P> Send for EventWorker<StateStore, C, P>
impl<StateStore, C, P> Sync for EventWorker<StateStore, C, P>
impl<StateStore, C, P> Unpin for EventWorker<StateStore, C, P>
impl<StateStore, C, P> !UnwindSafe for EventWorker<StateStore, C, 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