pub struct QueueServiceConfig {
pub default_policy: QueueServicePolicy,
pub overrides: Vec<QueueServiceOverride>,
pub service_availability_deadline: Option<Duration>,
pub schedule_to_start_timeout: Option<Duration>,
}Expand description
The operator’s queue-service settings.
§These are now the ONLY clocks that bound waiting for a worker
Worth stating here, where the clocks are set, because it changed and it is not obvious from anywhere else an operator reads.
An activity’s authored per-attempt timeout bounds the ATTEMPT — it starts when a worker accepts the work and the durable lease is recorded. It does NOT bound the time a dispatch spends waiting for a worker to exist. It used to, as a side effect of when the clock started, and that produced a bad answer twice over: an activity that waited eleven minutes and then ran for four seconds could blow a five-minute bound without ever having been slow, and the expiry could not cancel the dispatch it gave up on, so each one stacked another parked thread rather than freeing anything.
So the wait is bounded by Self::service_availability_deadline and
Self::schedule_to_start_timeout, and by nothing else. Both default to
None. A server whose operator has set neither will hold a dispatch to a
queue with no eligible worker indefinitely, visibly — the queue-service state
names the reason and GET /queues/unserved lists it — rather than failing it
on a clock that was measuring the wrong thing. No default is invented for
you: how long work may wait for a worker that does not exist is a decision
about your fleet, not one this server can make on your behalf.
Fields§
§default_policy: QueueServicePolicyPolicy for every queue with no written override. strict.
overrides: Vec<QueueServiceOverride>Written per-queue opt-ins. The first entry matching a dispatch wins, so a namespace-scoped entry placed before a namespace-less one is honoured.
service_availability_deadline: Option<Duration>How long a dispatch waits for a compatible worker to exist before a
typed WorkerUnavailable refusal. Unset = unbounded.
schedule_to_start_timeout: Option<Duration>How long a dispatch tries to hand its task to a live compatible worker
before a typed SATURATED refusal. Unset = one attempt, exactly as
before.
Implementations§
Source§impl QueueServiceConfig
impl QueueServiceConfig
Sourcepub fn policy_for(
&self,
namespace: &str,
task_queue: &str,
) -> QueueServicePolicy
pub fn policy_for( &self, namespace: &str, task_queue: &str, ) -> QueueServicePolicy
The policy governing one dispatch address.
Sourcepub const fn availability_deadline_for(
&self,
policy: QueueServicePolicy,
) -> Option<Duration>
pub const fn availability_deadline_for( &self, policy: QueueServicePolicy, ) -> Option<Duration>
Whether the service-availability deadline governs this dispatch.
durable_pending is precisely the declaration that this dispatch waits
for its worker, so the availability deadline — the strict policy’s
instrument for refusing rather than lying — does not cut it short. The
schedule-to-start clock still applies under both policies: it bounds a
hand-off to a worker that already exists, which is a different question.
Trait Implementations§
Source§impl Clone for QueueServiceConfig
impl Clone for QueueServiceConfig
Source§fn clone(&self) -> QueueServiceConfig
fn clone(&self) -> QueueServiceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QueueServiceConfig
impl Debug for QueueServiceConfig
Source§impl Default for QueueServiceConfig
impl Default for QueueServiceConfig
Source§fn default() -> QueueServiceConfig
fn default() -> QueueServiceConfig
Source§impl<'de> Deserialize<'de> for QueueServiceConfigwhere
QueueServiceConfig: Default,
impl<'de> Deserialize<'de> for QueueServiceConfigwhere
QueueServiceConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for QueueServiceConfig
Source§impl PartialEq for QueueServiceConfig
impl PartialEq for QueueServiceConfig
impl StructuralPartialEq for QueueServiceConfig
Auto Trait Implementations§
impl Freeze for QueueServiceConfig
impl RefUnwindSafe for QueueServiceConfig
impl Send for QueueServiceConfig
impl Sync for QueueServiceConfig
impl Unpin for QueueServiceConfig
impl UnsafeUnpin for QueueServiceConfig
impl UnwindSafe for QueueServiceConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request