pub trait ClientWorker: Send + Sync {
// Required methods
fn namespace(&self) -> &str;
fn task_queue(&self) -> &str;
fn try_reserve_wft_slot(&self) -> Option<Box<dyn Slot + Send>>;
fn deployment_options(&self) -> Option<WorkerDeploymentOptions>;
fn worker_instance_key(&self) -> Uuid;
fn heartbeat_enabled(&self) -> bool;
fn heartbeat_callback(&self) -> Option<HeartbeatCallback>;
fn new_shared_namespace_worker(
&self,
) -> Result<Box<dyn SharedNamespaceWorkerTrait + Send + Sync>, Error>;
fn worker_task_types(&self) -> WorkerTaskTypes;
}Expand description
Represents a complete worker that can handle both slot management and worker heartbeat functionality.
Required Methods§
Sourcefn task_queue(&self) -> &str
fn task_queue(&self) -> &str
The task queue this worker listens to
Sourcefn try_reserve_wft_slot(&self) -> Option<Box<dyn Slot + Send>>
fn try_reserve_wft_slot(&self) -> Option<Box<dyn Slot + Send>>
Try to reserve a slot for workflow task processing.
This method should return Some(slot) if a workflow task slot is available,
or None if all slots are currently in use. The returned slot will be used
to process exactly one workflow task.
Sourcefn deployment_options(&self) -> Option<WorkerDeploymentOptions>
fn deployment_options(&self) -> Option<WorkerDeploymentOptions>
Get the worker deployment options for this worker, if using deployment-based versioning.
Sourcefn worker_instance_key(&self) -> Uuid
fn worker_instance_key(&self) -> Uuid
Unique identifier for this worker instance. This must be stable across the worker’s lifetime and unique per instance.
Sourcefn heartbeat_enabled(&self) -> bool
fn heartbeat_enabled(&self) -> bool
Indicates if worker heartbeating is enabled for this client worker.
Sourcefn heartbeat_callback(&self) -> Option<HeartbeatCallback>
fn heartbeat_callback(&self) -> Option<HeartbeatCallback>
Returns the heartbeat callback that can be used to get WorkerHeartbeat data.
Creates a new worker that implements the SharedNamespaceWorkerTrait
Sourcefn worker_task_types(&self) -> WorkerTaskTypes
fn worker_task_types(&self) -> WorkerTaskTypes
Returns the task types this worker can handle