pub struct WorkerPool<B: QueueBackend + ?Sized> {
pub backend: Arc<B>,
/* private fields */
}Fields§
§backend: Arc<B>Implementations§
Source§impl<B: QueueBackend + 'static> WorkerPool<B>
impl<B: QueueBackend + 'static> WorkerPool<B>
pub fn new(backend: B, config: WorkerConfig) -> Self
Source§impl<B: QueueBackend + ?Sized + 'static> WorkerPool<B>
impl<B: QueueBackend + ?Sized + 'static> WorkerPool<B>
Sourcepub fn new_with_arc(backend: Arc<B>, config: WorkerConfig) -> Self
pub fn new_with_arc(backend: Arc<B>, config: WorkerConfig) -> Self
Create new worker pool from existing Arc backend (supports dyn dispatch)
Sourcepub fn register_job_type<J: Job + DeserializeOwned + 'static>(&self, name: &str)
pub fn register_job_type<J: Job + DeserializeOwned + 'static>(&self, name: &str)
Register a job type handler
Sourcepub fn register_job_factory<F>(&self, name: &str, factory: F)
pub fn register_job_factory<F>(&self, name: &str, factory: F)
Register a custom factory (useful for jobs with dependency injection)
pub async fn start(&self)
Auto Trait Implementations§
impl<B> Freeze for WorkerPool<B>where
B: ?Sized,
impl<B> RefUnwindSafe for WorkerPool<B>where
B: RefUnwindSafe + ?Sized,
impl<B> Send for WorkerPool<B>where
B: ?Sized,
impl<B> Sync for WorkerPool<B>where
B: ?Sized,
impl<B> Unpin for WorkerPool<B>where
B: ?Sized,
impl<B> UnsafeUnpin for WorkerPool<B>where
B: ?Sized,
impl<B> UnwindSafe for WorkerPool<B>where
B: RefUnwindSafe + ?Sized,
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