pub struct TaskRunner { /* private fields */ }Expand description
Task runner for a single worker type.
Implementations§
Source§impl TaskRunner
impl TaskRunner
Sourcepub fn new(
worker: Arc<dyn Worker>,
task_client: TaskClient,
event_dispatcher: EventDispatcher,
) -> Self
pub fn new( worker: Arc<dyn Worker>, task_client: TaskClient, event_dispatcher: EventDispatcher, ) -> Self
Create a new task runner.
Sourcepub fn config(&self) -> &WorkerConfig
pub fn config(&self) -> &WorkerConfig
Get the worker configuration.
Sourcepub fn active_task_count(&self) -> usize
pub fn active_task_count(&self) -> usize
Get the number of currently active tasks (executing, not waiting for semaphore).
Sourcepub fn spawned_task_count(&self) -> usize
pub fn spawned_task_count(&self) -> usize
Get the number of spawned tasks (including those waiting for semaphore).
Sourcepub fn poll_attempt_count(&self) -> u64
pub fn poll_attempt_count(&self) -> u64
Get the number of real poll attempts (successful or failed) made against the server so
far. Zero until the first one completes – see the field’s doc comment for why this
exists separately from TaskRunner::is_running.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the runner is running.
Auto Trait Implementations§
impl !RefUnwindSafe for TaskRunner
impl !UnwindSafe for TaskRunner
impl Freeze for TaskRunner
impl Send for TaskRunner
impl Sync for TaskRunner
impl Unpin for TaskRunner
impl UnsafeUnpin for TaskRunner
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