pub struct WorkerRegistry { /* private fields */ }Expand description
Worker registry for managing job handlers
Implementations§
Source§impl WorkerRegistry
impl WorkerRegistry
Sourcepub async fn register<T: Job + JobTypeProvider + 'static>(
&self,
handler: impl JobProcessor<T> + Send + Sync + 'static,
)
pub async fn register<T: Job + JobTypeProvider + 'static>( &self, handler: impl JobProcessor<T> + Send + Sync + 'static, )
Register a job handler for a specific job type
Sourcepub async fn get_handler(&self, job_type: &str) -> Option<JobHandler>
pub async fn get_handler(&self, job_type: &str) -> Option<JobHandler>
Get a handler for a job type
Sourcepub async fn list_job_types(&self) -> Vec<String>
pub async fn list_job_types(&self) -> Vec<String>
List all registered job types
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WorkerRegistry
impl !RefUnwindSafe for WorkerRegistry
impl Send for WorkerRegistry
impl Sync for WorkerRegistry
impl Unpin for WorkerRegistry
impl !UnwindSafe for WorkerRegistry
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