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
'life0: 'async_trait,
Self: 'async_trait;
}Available on crate feature
worker only.Expand description
Trait for actor for handling specific message type without context
Required Associated Types
type Result: MessageResponse<M>
type Result: MessageResponse<M>
Result of handler
Required Methods
Implementors
sourceimpl<T, W> Handler<JobRequestWrapper<T>> for W where
W: Worker<Job = T> + 'static,
T: Job + Serialize + Debug + DeserializeOwned + Send + 'static,
impl<T, W> Handler<JobRequestWrapper<T>> for W where
W: Worker<Job = T> + 'static,
T: Job + Serialize + Debug + DeserializeOwned + Send + 'static,
sourceimpl<T: 'static, S: 'static, H: 'static, F> Handler<StorageWorkerPulse> for StorageWorker<T, S, H> where
S: Storage<Output = T> + Unpin + Send + Sync,
T: Job + Serialize + Debug + DeserializeOwned + Send,
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: 'static, S: 'static, H: 'static, F> Handler<StorageWorkerPulse> for StorageWorker<T, S, H> where
S: Storage<Output = T> + Unpin + Send + Sync,
T: Job + Serialize + Debug + DeserializeOwned + Send,
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.