Struct apalis_core::worker::Worker
source · pub struct Worker<T> { /* private fields */ }
Expand description
Represents a generic Worker that can be in many different states
Implementations§
source§impl<S, P> Worker<Ready<S, P>>
impl<S, P> Worker<Ready<S, P>>
sourcepub fn with_executor<E, J>(self, executor: E) -> Worker<Context<E>>where
S: Service<Request<J>> + Send + 'static + Clone,
P: Backend<Request<J>> + 'static,
J: Send + 'static + Sync,
S::Future: Send,
S::Response: 'static,
S::Error: Send + Sync + 'static + Into<BoxDynError>,
<P as Backend<Request<J>>>::Stream: Unpin + Send + 'static,
E: Executor + Clone + Send + 'static + Sync,
pub fn with_executor<E, J>(self, executor: E) -> Worker<Context<E>>where
S: Service<Request<J>> + Send + 'static + Clone,
P: Backend<Request<J>> + 'static,
J: Send + 'static + Sync,
S::Future: Send,
S::Response: 'static,
S::Error: Send + Sync + 'static + Into<BoxDynError>,
<P as Backend<Request<J>>>::Stream: Unpin + Send + 'static,
E: Executor + Clone + Send + 'static + Sync,
Start a worker with a custom executor
sourcepub fn with_monitor<E, J>(self, monitor: &Monitor<E>) -> Worker<Context<E>>where
S: Service<Request<J>> + Send + 'static + Clone,
P: Backend<Request<J>> + 'static,
J: Send + 'static + Sync,
S::Future: Send,
S::Response: 'static,
S::Error: Send + Sync + 'static + Into<BoxDynError>,
<P as Backend<Request<J>>>::Stream: Unpin + Send + 'static,
E: Executor + Clone + Send + 'static + Sync,
pub fn with_monitor<E, J>(self, monitor: &Monitor<E>) -> Worker<Context<E>>where
S: Service<Request<J>> + Send + 'static + Clone,
P: Backend<Request<J>> + 'static,
J: Send + 'static + Sync,
S::Future: Send,
S::Response: 'static,
S::Error: Send + Sync + 'static + Into<BoxDynError>,
<P as Backend<Request<J>>>::Stream: Unpin + Send + 'static,
E: Executor + Clone + Send + 'static + Sync,
Run as a monitored worker
sourcepub fn with_monitor_instances<E, J>(
self,
instances: usize,
monitor: &Monitor<E>,
) -> Vec<Worker<Context<E>>>where
S: Service<Request<J>> + Send + 'static + Clone,
P: Backend<Request<J>> + 'static,
J: Send + 'static + Sync,
S::Future: Send,
S::Response: 'static,
S::Error: Send + Sync + 'static + Into<BoxDynError>,
<P as Backend<Request<J>>>::Stream: Unpin + Send + 'static,
E: Executor + Clone + Send + 'static + Sync,
pub fn with_monitor_instances<E, J>(
self,
instances: usize,
monitor: &Monitor<E>,
) -> Vec<Worker<Context<E>>>where
S: Service<Request<J>> + Send + 'static + Clone,
P: Backend<Request<J>> + 'static,
J: Send + 'static + Sync,
S::Future: Send,
S::Response: 'static,
S::Error: Send + Sync + 'static + Into<BoxDynError>,
<P as Backend<Request<J>>>::Stream: Unpin + Send + 'static,
E: Executor + Clone + Send + 'static + Sync,
Run a specified amounts of instances
sourcepub fn with_executor_instances<E, J>(
self,
instances: usize,
executor: E,
) -> Vec<Worker<Context<E>>>where
S: Service<Request<J>> + Send + 'static + Clone,
P: Backend<Request<J>> + 'static,
J: Send + 'static + Sync,
S::Future: Send,
S::Response: 'static,
S::Error: Send + Sync + 'static + Into<BoxDynError>,
<P as Backend<Request<J>>>::Stream: Unpin + Send + 'static,
E: Executor + Clone + Send + 'static + Sync,
pub fn with_executor_instances<E, J>(
self,
instances: usize,
executor: E,
) -> Vec<Worker<Context<E>>>where
S: Service<Request<J>> + Send + 'static + Clone,
P: Backend<Request<J>> + 'static,
J: Send + 'static + Sync,
S::Future: Send,
S::Response: 'static,
S::Error: Send + Sync + 'static + Into<BoxDynError>,
<P as Backend<Request<J>>>::Stream: Unpin + Send + 'static,
E: Executor + Clone + Send + 'static + Sync,
Run specified worker instances via a specific executor
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Worker<T>where
T: Freeze,
impl<T> RefUnwindSafe for Worker<T>where
T: RefUnwindSafe,
impl<T> Send for Worker<T>where
T: Send,
impl<T> Sync for Worker<T>where
T: Sync,
impl<T> Unpin for Worker<T>where
T: Unpin,
impl<T> UnwindSafe for Worker<T>where
T: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)