Trait apalis_core::worker::Handler
source · pub trait Handler<M: Message>: Actor {
type Result: MessageResponse<M>;
fn handle<'life0, 'async_trait>(
&'life0 mut self,
msg: M
) -> Pin<Box<dyn Future<Output = Self::Result> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
}Available on crate feature
worker only.Expand description
Trait for actor for handling specific message type without context
Required Associated Types§
sourcetype Result: MessageResponse<M>
type Result: MessageResponse<M>
Result of handler
Required Methods§
Implementors§
source§impl<T, S, H, F> Handler<StorageWorkerPulse> for StorageWorker<T, S, H>where
S: Storage<Output = T> + Unpin + Send + Sync + 'static,
T: Job + Send + 'static,
H: Service<JobRequest<T>, Response = JobResult, Error = JobError, Future = F> + Unpin + Send + 'static,
F: Future<Output = Result<JobResult, JobError>> + Send,
Available on crate feature storage only.
impl<T, S, H, F> Handler<StorageWorkerPulse> for StorageWorker<T, S, H>where
S: Storage<Output = T> + Unpin + Send + Sync + 'static,
T: Job + Send + 'static,
H: Service<JobRequest<T>, Response = JobResult, Error = JobError, Future = F> + Unpin + Send + 'static,
F: Future<Output = Result<JobResult, JobError>> + Send,
Available on crate feature
storage only.