Struct apalis_core::storage::StorageWorker
source · [−]Available on crate feature
storage only.Expand description
A queue represents a consumer of a Storage.
A [Service] must be provided to be called when a new job is detected.
Implementations
sourceimpl<T, S, H> StorageWorker<T, S, H> where
T: 'static + Job + Serialize + Debug + DeserializeOwned,
S: 'static + Storage<Output = T> + Unpin,
impl<T, S, H> StorageWorker<T, S, H> where
T: 'static + Job + Serialize + Debug + DeserializeOwned,
S: 'static + Storage<Output = T> + Unpin,
Trait Implementations
sourceimpl<T: Debug + Serialize, S: Debug + Storage<Output = T>, H: Debug> Debug for StorageWorker<T, S, H>
impl<T: Debug + Serialize, S: Debug + Storage<Output = T>, H: Debug> Debug for StorageWorker<T, S, H>
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,
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,
sourceimpl<T, S, H, F> Worker for StorageWorker<T, S, H> where
S: JobStream<Job = T> + Storage + Unpin + Storage<Output = T> + Send + 'static + Sync,
T: Job + Send + 'static,
H: Service<JobRequest<T>, Response = JobResult, Error = JobError, Future = F> + Unpin + Send + 'static,
F: Future<Output = Result<JobResult, JobError>> + Send,
impl<T, S, H, F> Worker for StorageWorker<T, S, H> where
S: JobStream<Job = T> + Storage + Unpin + Storage<Output = T> + Send + 'static + Sync,
T: Job + Send + 'static,
H: Service<JobRequest<T>, Response = JobResult, Error = JobError, Future = F> + Unpin + Send + 'static,
F: Future<Output = Result<JobResult, JobError>> + Send,
sourcefn on_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn on_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Available on crate feature
worker only.At start hook of worker
sourcefn on_stop<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn on_stop<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Available on crate feature
worker only.At stop hook of worker
sourcefn consume(&mut self) -> JobStreamResult<Self::Job>
fn consume(&mut self) -> JobStreamResult<Self::Job>
Available on crate feature
worker only.Returns a streams of jobs for the worker to consume
sourcefn service(&mut self) -> &mut Self::Service
fn service(&mut self) -> &mut Self::Service
Available on crate feature
worker only.Returns the service that handles the job
sourcefn handle_job<'life0, 'async_trait>(
&'life0 mut self,
job: JobRequest<Self::Job>
) -> Pin<Box<dyn Future<Output = Result<JobResult, JobError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn handle_job<'life0, 'async_trait>(
&'life0 mut self,
job: JobRequest<Self::Job>
) -> Pin<Box<dyn Future<Output = Result<JobResult, JobError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Available on crate feature
worker only.The way the worker will handle a job
sourcefn manage<'life0, 'async_trait>(
&'life0 mut self,
_msg: WorkerManagement
) -> Pin<Box<dyn Future<Output = Result<WorkerStatus, WorkerError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn manage<'life0, 'async_trait>(
&'life0 mut self,
_msg: WorkerManagement
) -> Pin<Box<dyn Future<Output = Result<WorkerStatus, WorkerError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Available on crate feature
worker only.Manage a worker
Auto Trait Implementations
impl<T, S, H> RefUnwindSafe for StorageWorker<T, S, H> where
H: RefUnwindSafe,
S: RefUnwindSafe,
impl<T, S, H> Send for StorageWorker<T, S, H> where
H: Send,
S: Send,
impl<T, S, H> Sync for StorageWorker<T, S, H> where
H: Sync,
S: Sync,
impl<T, S, H> Unpin for StorageWorker<T, S, H> where
H: Unpin,
S: Unpin,
impl<T, S, H> UnwindSafe for StorageWorker<T, S, H> where
H: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
sourceimpl<T, W> Actor for W where
T: 'static + Send,
W: 'static + Worker<Job = T> + Handler<JobRequestWrapper<T>>,
impl<T, W> Actor for W where
T: 'static + Send,
W: 'static + Worker<Job = T> + Handler<JobRequestWrapper<T>>,
sourcefn on_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Context<W>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
W: 'async_trait,
Available on crate feature worker only.
fn on_start<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Context<W>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
W: 'async_trait,
worker only.At start hook of actor
sourcefn on_stop<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Context<W>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
W: 'async_trait,
Available on crate feature worker only.
fn on_stop<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Context<W>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
W: 'async_trait,
worker only.At stop hook of actor
sourcefn mailbox_capacity(&self) -> usize
fn mailbox_capacity(&self) -> usize
Available on crate feature
worker only.Capacity of worker queue
sourcefn preinit(self) -> InitializedActor<Self>
fn preinit(self) -> InitializedActor<Self>
Available on crate feature
worker only.Initilize actor with its address.
sourcefn preinit_default() -> InitializedActor<Self> where
Self: Default,
fn preinit_default() -> InitializedActor<Self> where
Self: Default,
Available on crate feature
worker only.Initialize actor with default values
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<M, S> ContextHandler<M> for S where
M: 'static + Message + Send,
S: Handler<M>,
impl<M, S> ContextHandler<M> for S where
M: 'static + Message + Send,
S: Handler<M>,
sourcefn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
__arg1: &'life1 mut Context<S>,
msg: M
) -> Pin<Box<dyn Future<Output = <S as ContextHandler<M>>::Result> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
S: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
__arg1: &'life1 mut Context<S>,
msg: M
) -> Pin<Box<dyn Future<Output = <S as ContextHandler<M>>::Result> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
S: 'async_trait,
Available on crate feature
worker only.Message handler
sourceimpl<T, W> Handler<JobRequestWrapper<T>> for W where
W: 'static + Worker<Job = T>,
T: 'static + Job + Serialize + Debug + DeserializeOwned + Send,
impl<T, W> Handler<JobRequestWrapper<T>> for W where
W: 'static + Worker<Job = T>,
T: 'static + Job + Serialize + Debug + DeserializeOwned + Send,
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more