pub struct Worker { /* private fields */ }
Implementations§
Source§impl Worker
impl Worker
pub fn new( id: String, broker: Arc<RedisBroker>, scheduler: Arc<TaskScheduler>, ) -> Self
pub fn with_task_registry(self, registry: Arc<TaskRegistry>) -> Self
pub fn with_backpressure_config(self, config: WorkerBackpressureConfig) -> Self
pub fn with_max_concurrent_tasks(self, max_tasks: usize) -> Self
Sourcepub fn active_task_count(&self) -> usize
pub fn active_task_count(&self) -> usize
Get the current number of active tasks
pub async fn start(self) -> Result<Self, TaskQueueError>
pub async fn stop(self)
Auto Trait Implementations§
impl Freeze for Worker
impl !RefUnwindSafe for Worker
impl Send for Worker
impl Sync for Worker
impl Unpin for Worker
impl !UnwindSafe for Worker
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