pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
pub fn new(base_url: impl Into<String>) -> Result<Self>
pub fn builder(base_url: impl Into<String>) -> ClientBuilder
pub async fn health(&self) -> Result<Value>
pub async fn cluster_info(&self) -> Result<Value>
pub async fn start_workflow<T: Serialize>( &self, workflow_type: &str, task_queue: &str, workflow_id: &str, input: T, ) -> Result<WorkflowHandle>
Sourcepub async fn start_workflow_with_options<T: Serialize>(
&self,
workflow_type: &str,
task_queue: &str,
workflow_id: &str,
options: WorkflowStartOptions,
input: T,
) -> Result<WorkflowHandle>
pub async fn start_workflow_with_options<T: Serialize>( &self, workflow_type: &str, task_queue: &str, workflow_id: &str, options: WorkflowStartOptions, input: T, ) -> Result<WorkflowHandle>
Start a workflow with explicit server-enforced execution and run deadlines.
pub async fn signal_workflow<T: Serialize>( &self, workflow_id: &str, signal_name: &str, input: T, ) -> Result<Value>
Sourcepub async fn cancel_workflow(
&self,
workflow_id: &str,
options: WorkflowCommandOptions,
) -> Result<WorkflowCommandResult>
pub async fn cancel_workflow( &self, workflow_id: &str, options: WorkflowCommandOptions, ) -> Result<WorkflowCommandResult>
Request cooperative cancellation of the current run for an instance.
Sourcepub async fn cancel_workflow_run(
&self,
workflow_id: &str,
run_id: &str,
options: WorkflowCommandOptions,
) -> Result<WorkflowCommandResult>
pub async fn cancel_workflow_run( &self, workflow_id: &str, run_id: &str, options: WorkflowCommandOptions, ) -> Result<WorkflowCommandResult>
Request cooperative cancellation only if run_id is still current.
Sourcepub async fn terminate_workflow(
&self,
workflow_id: &str,
options: WorkflowCommandOptions,
) -> Result<WorkflowCommandResult>
pub async fn terminate_workflow( &self, workflow_id: &str, options: WorkflowCommandOptions, ) -> Result<WorkflowCommandResult>
Forcefully terminate the current run for an instance.
Sourcepub async fn terminate_workflow_run(
&self,
workflow_id: &str,
run_id: &str,
options: WorkflowCommandOptions,
) -> Result<WorkflowCommandResult>
pub async fn terminate_workflow_run( &self, workflow_id: &str, run_id: &str, options: WorkflowCommandOptions, ) -> Result<WorkflowCommandResult>
Forcefully terminate only if run_id is still current.
Sourcepub async fn query_workflow<T: Serialize>(
&self,
workflow_id: &str,
query_name: &str,
input: T,
) -> Result<Value>
pub async fn query_workflow<T: Serialize>( &self, workflow_id: &str, query_name: &str, input: T, ) -> Result<Value>
Execute a named, read-only query against a running or completed workflow.
Arguments and results use the platform payload envelope. Server and
worker rejections are returned as Error::QueryFailed with a stable
reason, HTTP status, and original response body.
pub async fn describe_workflow( &self, workflow_id: &str, ) -> Result<WorkflowDescription>
Sourcepub async fn describe_workflow_run(
&self,
workflow_id: &str,
run_id: &str,
) -> Result<WorkflowDescription>
pub async fn describe_workflow_run( &self, workflow_id: &str, run_id: &str, ) -> Result<WorkflowDescription>
Describe one selected run, including historical terminal runs.
pub async fn register_worker( &self, worker_id: &str, task_queue: &str, supported_workflow_types: Vec<String>, supported_activity_types: Vec<String>, max_concurrent_workflow_tasks: usize, max_concurrent_activity_tasks: usize, ) -> Result<RegisterWorkerResponse>
Sourcepub async fn register_worker_with_capabilities(
&self,
worker_id: &str,
task_queue: &str,
supported_workflow_types: Vec<String>,
supported_activity_types: Vec<String>,
max_concurrent_workflow_tasks: usize,
max_concurrent_activity_tasks: usize,
capabilities: Vec<String>,
) -> Result<RegisterWorkerResponse>
pub async fn register_worker_with_capabilities( &self, worker_id: &str, task_queue: &str, supported_workflow_types: Vec<String>, supported_activity_types: Vec<String>, max_concurrent_workflow_tasks: usize, max_concurrent_activity_tasks: usize, capabilities: Vec<String>, ) -> Result<RegisterWorkerResponse>
Register a worker and explicitly advertise additive worker capabilities.
Sourcepub async fn poll_query_task(
&self,
worker_id: &str,
task_queue: &str,
timeout: Duration,
) -> Result<Option<QueryTask>>
pub async fn poll_query_task( &self, worker_id: &str, task_queue: &str, timeout: Duration, ) -> Result<Option<QueryTask>>
Long-poll for an ephemeral, read-only workflow query task.
Sourcepub async fn poll_query_task_response(
&self,
worker_id: &str,
task_queue: &str,
timeout: Duration,
) -> Result<PollQueryTaskResponse>
pub async fn poll_query_task_response( &self, worker_id: &str, task_queue: &str, timeout: Duration, ) -> Result<PollQueryTaskResponse>
Poll a query task while preserving server stop and drain metadata.
Sourcepub async fn complete_query_task(
&self,
query_task_id: &str,
lease_owner: &str,
query_task_attempt: u64,
result: Value,
codec: &str,
) -> Result<Value>
pub async fn complete_query_task( &self, query_task_id: &str, lease_owner: &str, query_task_attempt: u64, result: Value, codec: &str, ) -> Result<Value>
Complete a query task without appending workflow history.
Sourcepub async fn fail_query_task(
&self,
query_task_id: &str,
lease_owner: &str,
query_task_attempt: u64,
message: impl Into<String>,
reason: impl Into<String>,
failure_type: impl Into<String>,
) -> Result<Value>
pub async fn fail_query_task( &self, query_task_id: &str, lease_owner: &str, query_task_attempt: u64, message: impl Into<String>, reason: impl Into<String>, failure_type: impl Into<String>, ) -> Result<Value>
Report a stable machine-readable query-task failure.
pub async fn heartbeat_worker( &self, worker_id: &str, workflow_available: usize, activity_available: usize, ) -> Result<Value>
pub async fn poll_workflow_task( &self, worker_id: &str, task_queue: &str, timeout: Duration, ) -> Result<Option<WorkflowTask>>
pub async fn poll_workflow_task_response( &self, worker_id: &str, task_queue: &str, timeout: Duration, ) -> Result<PollWorkflowTaskResponse>
pub async fn complete_workflow_task( &self, task_id: &str, lease_owner: &str, workflow_task_attempt: u64, commands: Vec<Value>, ) -> Result<Value>
pub async fn fail_workflow_task( &self, task_id: &str, lease_owner: &str, workflow_task_attempt: u64, message: impl Into<String>, ) -> Result<Value>
pub async fn poll_activity_task( &self, worker_id: &str, task_queue: &str, timeout: Duration, ) -> Result<Option<ActivityTask>>
Sourcepub async fn poll_activity_task_response(
&self,
worker_id: &str,
task_queue: &str,
timeout: Duration,
) -> Result<PollActivityTaskResponse>
pub async fn poll_activity_task_response( &self, worker_id: &str, task_queue: &str, timeout: Duration, ) -> Result<PollActivityTaskResponse>
Poll an activity task while preserving server stop and drain metadata.