pub struct QueueServiceState { /* private fields */ }Expand description
Shared handle onto the live unserved-queue state.
Implementations§
Source§impl QueueServiceState
impl QueueServiceState
Sourcepub fn mark(&self, parked: Parked<'_>) -> Result<(), ServerError>
pub fn mark(&self, parked: Parked<'_>) -> Result<(), ServerError>
Record (or refresh) one dispatch parked on an unserved address.
§Errors
Returns ServerError::LockPoisoned if the state lock is poisoned.
Sourcepub fn clear(
&self,
address: &ServiceAddress,
workflow_id: &WorkflowId,
activity_id: &ActivityId,
) -> Result<(), ServerError>
pub fn clear( &self, address: &ServiceAddress, workflow_id: &WorkflowId, activity_id: &ActivityId, ) -> Result<(), ServerError>
Drop one dispatch from the unserved state, dropping the address itself when nothing waits on it any more.
§Errors
Returns ServerError::LockPoisoned if the state lock is poisoned.
Sourcepub fn unserved(&self) -> Result<Vec<UnservedQueue>, ServerError>
pub fn unserved(&self) -> Result<Vec<UnservedQueue>, ServerError>
Every address currently unserved, in stable address order.
§Errors
Returns ServerError::LockPoisoned if the state lock is poisoned.
Sourcepub fn parked_on_queue(&self, task_queue: &str) -> Result<usize, ServerError>
pub fn parked_on_queue(&self, task_queue: &str) -> Result<usize, ServerError>
How many dispatches are currently parked across every address on
task_queue, in any namespace.
Read by the worker-expiry sweep so the deregistration of a dead worker states the operational consequence in the same breath as the cause: “this worker is gone AND seven dispatches are already parked on the queue it was serving” is an alertable sentence; “worker deregistered” alone is not. Queue-scoped rather than address-scoped because a worker serves a whole queue, not one activity type on it.
§Errors
Returns ServerError::LockPoisoned if the state lock is poisoned.
Sourcepub fn is_unserved(
&self,
workflow_id: &WorkflowId,
activity_id: &ActivityId,
) -> Result<bool, ServerError>
pub fn is_unserved( &self, workflow_id: &WorkflowId, activity_id: &ActivityId, ) -> Result<bool, ServerError>
Whether one run’s activity is currently parked on an unserved queue.
§Errors
Returns ServerError::LockPoisoned if the state lock is poisoned.
Trait Implementations§
Source§impl Clone for QueueServiceState
impl Clone for QueueServiceState
Source§fn clone(&self) -> QueueServiceState
fn clone(&self) -> QueueServiceState
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 QueueServiceState
impl Debug for QueueServiceState
Source§impl Default for QueueServiceState
impl Default for QueueServiceState
Source§fn default() -> QueueServiceState
fn default() -> QueueServiceState
Auto Trait Implementations§
impl Freeze for QueueServiceState
impl RefUnwindSafe for QueueServiceState
impl Send for QueueServiceState
impl Sync for QueueServiceState
impl Unpin for QueueServiceState
impl UnsafeUnpin for QueueServiceState
impl UnwindSafe for QueueServiceState
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,
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> 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