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§
Sourcefn 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_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
Sourcefn 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_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
Sourcefn 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 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
Sourcefn 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_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
Sourcefn 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_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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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_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
Sourcefn 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_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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn replace_client(&self, new_client: Client)
fn replace_client(&self, new_client: Client)
Replace the underlying client
Sourcefn capabilities(&self) -> Option<Capabilities>
fn capabilities(&self) -> Option<Capabilities>
Return server capabilities
Sourcefn workers(&self) -> Arc<SlotManager>
fn workers(&self) -> Arc<SlotManager>
Return workers using this client
Sourcefn sdk_name_and_version(&self) -> (String, String)
fn sdk_name_and_version(&self) -> (String, String)
Return name and version of the SDK
Sourcefn get_identity(&self) -> String
fn get_identity(&self) -> String
Get worker identity