pub struct QueueHandle { /* private fields */ }Implementations§
Source§impl QueueHandle
impl QueueHandle
Sourcepub fn rate_limit(&self) -> &RateLimiter
pub fn rate_limit(&self) -> &RateLimiter
Cluster-wide rate limiter — same instance every worker’s
JobCtx::rate_limit points at. Surfaced so out-of-band
callers (e.g. cron tasks spawned outside the worker loop)
can acquire against the same budget as in-flight jobs.
Sourcepub fn request_cancel(&self, job_id: &JobId) -> bool
pub fn request_cancel(&self, job_id: &JobId) -> bool
Signal a cancel for an in-flight job by id.
If the job is running on this pod, cancels its in-process
token immediately and returns true. If the job isn’t on
this pod (or isn’t running at all) returns false; cross-pod
cancels go through JobQueue::delete on an in_progress
row, which sets a DB flag the owning pod’s heartbeat tick
observes within HEARTBEAT_INTERVAL.
Sourcepub async fn enqueue(&self, req: EnqueueRequest) -> Result<EnqueueOutcome>
pub async fn enqueue(&self, req: EnqueueRequest) -> Result<EnqueueOutcome>
Enqueue from a different task after start. Same semantics as
QueueRuntime::enqueue.
Sourcepub async fn shutdown_graceful(self, timeout: Duration)
pub async fn shutdown_graceful(self, timeout: Duration)
Signal shutdown, wait up to timeout for in-flight jobs to
drain, then delete process registry rows for this host.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for QueueHandle
impl !UnwindSafe for QueueHandle
impl Freeze for QueueHandle
impl Send for QueueHandle
impl Sync for QueueHandle
impl Unpin for QueueHandle
impl UnsafeUnpin for QueueHandle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more