Skip to main content

SlotReservationContext

Trait SlotReservationContext 

Source
pub trait SlotReservationContext: Send + Sync {
    // Required methods
    fn task_queue(&self) -> &str;
    fn worker_identity(&self) -> &str;
    fn worker_deployment_version(&self) -> &Option<WorkerDeploymentVersion>;
    fn num_issued_slots(&self) -> usize;
    fn is_sticky(&self) -> bool;

    // Provided method
    fn get_metrics_meter(&self) -> Option<TemporalMeter> { ... }
}
Expand description

Context for slot reservation.

Required Methods§

Source

fn task_queue(&self) -> &str

Returns the name of the task queue this worker is polling

Source

fn worker_identity(&self) -> &str

Returns the identity of the worker

Source

fn worker_deployment_version(&self) -> &Option<WorkerDeploymentVersion>

Returns the deployment version of the worker, if one is set.

Source

fn num_issued_slots(&self) -> usize

Returns the number of currently outstanding slot permits, whether used or un-used.

Source

fn is_sticky(&self) -> bool

Returns true iff this is a sticky poll for a workflow task

Provided Methods§

Source

fn get_metrics_meter(&self) -> Option<TemporalMeter>

Returns the metrics meter if metrics are enabled

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§