WorkerClient

Trait WorkerClient 

Source
pub trait WorkerClient: Sync + Send {
Show 22 methods // Required methods fn poll_workflow_task<'life0, 'async_trait>( &'life0 self, poll_options: PollOptions, wf_options: PollWorkflowOptions, ) -> Pin<Box<dyn Future<Output = Result<PollWorkflowTaskQueueResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn poll_activity_task<'life0, 'async_trait>( &'life0 self, poll_options: PollOptions, act_options: PollActivityOptions, ) -> Pin<Box<dyn Future<Output = Result<PollActivityTaskQueueResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn poll_nexus_task<'life0, 'async_trait>( &'life0 self, poll_options: PollOptions, ) -> Pin<Box<dyn Future<Output = Result<PollNexusTaskQueueResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn complete_workflow_task<'life0, 'async_trait>( &'life0 self, request: WorkflowTaskCompletion, ) -> Pin<Box<dyn Future<Output = Result<RespondWorkflowTaskCompletedResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn complete_activity_task<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, result: Option<Payloads>, ) -> Pin<Box<dyn Future<Output = Result<RespondActivityTaskCompletedResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn complete_nexus_task<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, response: Response, ) -> Pin<Box<dyn Future<Output = Result<RespondNexusTaskCompletedResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn record_activity_heartbeat<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, details: Option<Payloads>, ) -> Pin<Box<dyn Future<Output = Result<RecordActivityTaskHeartbeatResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn cancel_activity_task<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, details: Option<Payloads>, ) -> Pin<Box<dyn Future<Output = Result<RespondActivityTaskCanceledResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn fail_activity_task<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, failure: Option<Failure>, ) -> Pin<Box<dyn Future<Output = Result<RespondActivityTaskFailedResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn fail_workflow_task<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, cause: WorkflowTaskFailedCause, failure: Option<Failure>, ) -> Pin<Box<dyn Future<Output = Result<RespondWorkflowTaskFailedResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn fail_nexus_task<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, error: HandlerError, ) -> Pin<Box<dyn Future<Output = Result<RespondNexusTaskFailedResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_workflow_execution_history<'life0, 'async_trait>( &'life0 self, workflow_id: String, run_id: Option<String>, page_token: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<GetWorkflowExecutionHistoryResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn respond_legacy_query<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, query_result: LegacyQueryResult, ) -> Pin<Box<dyn Future<Output = Result<RespondQueryTaskCompletedResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn describe_namespace<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<DescribeNamespaceResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn shutdown_worker<'life0, 'async_trait>( &'life0 self, sticky_task_queue: String, ) -> Pin<Box<dyn Future<Output = Result<ShutdownWorkerResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn record_worker_heartbeat<'life0, 'async_trait>( &'life0 self, heartbeat: WorkerHeartbeat, ) -> Pin<Box<dyn Future<Output = Result<RecordWorkerHeartbeatResponse, Status>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn replace_client(&self, new_client: Client); fn capabilities(&self) -> Option<Capabilities>; fn workers(&self) -> Arc<SlotManager>; fn is_mock(&self) -> bool; fn sdk_name_and_version(&self) -> (String, String); fn get_identity(&self) -> String;
}
Expand description

Expose WorkerClient symbols This trait contains everything workers need to interact with Temporal, and hence provides a minimal mocking surface. Delegates to [WorkflowClientTrait] so see that for details.

Required Methods§

Source

fn poll_workflow_task<'life0, 'async_trait>( &'life0 self, poll_options: PollOptions, wf_options: PollWorkflowOptions, ) -> Pin<Box<dyn Future<Output = Result<PollWorkflowTaskQueueResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Poll workflow tasks

Source

fn poll_activity_task<'life0, 'async_trait>( &'life0 self, poll_options: PollOptions, act_options: PollActivityOptions, ) -> Pin<Box<dyn Future<Output = Result<PollActivityTaskQueueResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Poll activity tasks

Source

fn poll_nexus_task<'life0, 'async_trait>( &'life0 self, poll_options: PollOptions, ) -> Pin<Box<dyn Future<Output = Result<PollNexusTaskQueueResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Poll Nexus tasks

Source

fn complete_workflow_task<'life0, 'async_trait>( &'life0 self, request: WorkflowTaskCompletion, ) -> Pin<Box<dyn Future<Output = Result<RespondWorkflowTaskCompletedResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Complete a workflow task

Source

fn complete_activity_task<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, result: Option<Payloads>, ) -> Pin<Box<dyn Future<Output = Result<RespondActivityTaskCompletedResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Complete an activity task

Source

fn complete_nexus_task<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, response: Response, ) -> Pin<Box<dyn Future<Output = Result<RespondNexusTaskCompletedResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Complete a Nexus task

Source

fn record_activity_heartbeat<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, details: Option<Payloads>, ) -> Pin<Box<dyn Future<Output = Result<RecordActivityTaskHeartbeatResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Record an activity heartbeat

Source

fn cancel_activity_task<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, details: Option<Payloads>, ) -> Pin<Box<dyn Future<Output = Result<RespondActivityTaskCanceledResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cancel an activity task

Source

fn fail_activity_task<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, failure: Option<Failure>, ) -> Pin<Box<dyn Future<Output = Result<RespondActivityTaskFailedResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fail an activity task

Source

fn fail_workflow_task<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, cause: WorkflowTaskFailedCause, failure: Option<Failure>, ) -> Pin<Box<dyn Future<Output = Result<RespondWorkflowTaskFailedResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fail a workflow task

Source

fn fail_nexus_task<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, error: HandlerError, ) -> Pin<Box<dyn Future<Output = Result<RespondNexusTaskFailedResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fail a Nexus task

Source

fn get_workflow_execution_history<'life0, 'async_trait>( &'life0 self, workflow_id: String, run_id: Option<String>, page_token: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<GetWorkflowExecutionHistoryResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the workflow execution history

Source

fn respond_legacy_query<'life0, 'async_trait>( &'life0 self, task_token: TaskToken, query_result: LegacyQueryResult, ) -> Pin<Box<dyn Future<Output = Result<RespondQueryTaskCompletedResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Respond to a legacy query

Source

fn describe_namespace<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<DescribeNamespaceResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Describe the namespace

Source

fn shutdown_worker<'life0, 'async_trait>( &'life0 self, sticky_task_queue: String, ) -> Pin<Box<dyn Future<Output = Result<ShutdownWorkerResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Shutdown the worker

Source

fn record_worker_heartbeat<'life0, 'async_trait>( &'life0 self, heartbeat: WorkerHeartbeat, ) -> Pin<Box<dyn Future<Output = Result<RecordWorkerHeartbeatResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Record a worker heartbeat

Source

fn replace_client(&self, new_client: Client)

Replace the underlying client

Source

fn capabilities(&self) -> Option<Capabilities>

Return server capabilities

Source

fn workers(&self) -> Arc<SlotManager>

Return workers using this client

Source

fn is_mock(&self) -> bool

Indicates if this is a mock client

Source

fn sdk_name_and_version(&self) -> (String, String)

Return name and version of the SDK

Source

fn get_identity(&self) -> String

Get worker identity

Implementors§