Class ITemporalClientExtensions
- Namespace
- Temporalio.Client
- Assembly
- Temporalio.dll
Extensions for ITemporalClient.
public static class ITemporalClientExtensions
- Inheritance
-
ITemporalClientExtensions
- Inherited Members
Methods
ExecuteUpdateWithStartWorkflowAsync(ITemporalClient, string, IReadOnlyCollection<object?>, WorkflowUpdateWithStartOptions)
Start an update using its name, possibly starting the workflow at the same time. Note that in some cases this call may fail but the workflow will still be started. This is a shortcut for StartUpdateWithStartWorkflowAsync(string, IReadOnlyCollection<object?>, WorkflowStartUpdateWithStartOptions) + GetResultAsync(RpcOptions?).
public static Task ExecuteUpdateWithStartWorkflowAsync(this ITemporalClient client, string update, IReadOnlyCollection<object?> args, WorkflowUpdateWithStartOptions options)
Parameters
client
ITemporalClientClient to use.
update
stringName of the update.
args
IReadOnlyCollection<object>Arguments for the update.
options
WorkflowUpdateWithStartOptionsUpdate options.
Returns
- Task
Completed update task.
Remarks
WARNING: Workflow update with start is experimental and APIs may change.
Exceptions
- ArgumentException
Invalid run call or options.
- WorkflowAlreadyStartedException
Workflow was already started according to ID reuse and conflict policy.
- WorkflowUpdateFailedException
Workflow update failed, but the with-start operation still got a workflow handle.
- RpcException
Server-side error.
ExecuteUpdateWithStartWorkflowAsync<TWorkflow>(ITemporalClient, Expression<Func<TWorkflow, Task>>, WorkflowUpdateWithStartOptions)
Start an update via a call to a WorkflowUpdate attributed method, possibly starting the workflow at the same time. Note that in some cases this call may fail but the workflow will still be started. This is a shortcut for StartUpdateWithStartWorkflowAsync<TWorkflow>(Expression<Func<TWorkflow, Task>>, WorkflowStartUpdateWithStartOptions) + GetResultAsync(RpcOptions?).
public static Task ExecuteUpdateWithStartWorkflowAsync<TWorkflow>(this ITemporalClient client, Expression<Func<TWorkflow, Task>> updateCall, WorkflowUpdateWithStartOptions options)
Parameters
client
ITemporalClientClient to use.
updateCall
Expression<Func<TWorkflow, Task>>Invocation of workflow update method.
options
WorkflowUpdateWithStartOptionsUpdate options.
Returns
- Task
Completed update task.
Type Parameters
TWorkflow
Workflow class type.
Remarks
WARNING: Workflow update with start is experimental and APIs may change.
Exceptions
- ArgumentException
Invalid run call or options.
- WorkflowAlreadyStartedException
Workflow was already started according to ID reuse and conflict policy.
- WorkflowUpdateFailedException
Workflow update failed, but the with-start operation still got a workflow handle.
- RpcException
Server-side error.
ExecuteUpdateWithStartWorkflowAsync<TUpdateResult>(ITemporalClient, string, IReadOnlyCollection<object?>, WorkflowUpdateWithStartOptions)
Start an update using its name, possibly starting the workflow at the same time. Note that in some cases this call may fail but the workflow will still be started. This is a shortcut for StartUpdateWithStartWorkflowAsync<TUpdateResult>(string, IReadOnlyCollection<object?>, WorkflowStartUpdateWithStartOptions) + GetResultAsync(RpcOptions?).
public static Task<TUpdateResult> ExecuteUpdateWithStartWorkflowAsync<TUpdateResult>(this ITemporalClient client, string update, IReadOnlyCollection<object?> args, WorkflowUpdateWithStartOptions options)
Parameters
client
ITemporalClientClient to use.
update
stringName of the update.
args
IReadOnlyCollection<object>Arguments for the update.
options
WorkflowUpdateWithStartOptionsUpdate options.
Returns
- Task<TUpdateResult>
Completed update task.
Type Parameters
TUpdateResult
Update result type.
Remarks
WARNING: Workflow update with start is experimental and APIs may change.
Exceptions
- ArgumentException
Invalid run call or options.
- WorkflowAlreadyStartedException
Workflow was already started according to ID reuse and conflict policy.
- WorkflowUpdateFailedException
Workflow update failed, but the with-start operation still got a workflow handle.
- RpcException
Server-side error.
ExecuteUpdateWithStartWorkflowAsync<TWorkflow, TUpdateResult>(ITemporalClient, Expression<Func<TWorkflow, Task<TUpdateResult>>>, WorkflowUpdateWithStartOptions)
Start an update via a call to a WorkflowUpdate attributed method, possibly starting the workflow at the same time. Note that in some cases this call may fail but the workflow will still be started. This is a shortcut for StartUpdateWithStartWorkflowAsync<TWorkflow, TUpdateResult>(Expression<Func<TWorkflow, Task<TUpdateResult>>>, WorkflowStartUpdateWithStartOptions) + GetResultAsync(RpcOptions?).
public static Task<TUpdateResult> ExecuteUpdateWithStartWorkflowAsync<TWorkflow, TUpdateResult>(this ITemporalClient client, Expression<Func<TWorkflow, Task<TUpdateResult>>> updateCall, WorkflowUpdateWithStartOptions options)
Parameters
client
ITemporalClientClient to use.
updateCall
Expression<Func<TWorkflow, Task<TUpdateResult>>>Invocation of workflow update method.
options
WorkflowUpdateWithStartOptionsUpdate options.
Returns
- Task<TUpdateResult>
Completed update task.
Type Parameters
TWorkflow
Workflow class type.
TUpdateResult
Update result type.
Remarks
WARNING: Workflow update with start is experimental and APIs may change.
Exceptions
- ArgumentException
Invalid run call or options.
- WorkflowAlreadyStartedException
Workflow was already started according to ID reuse and conflict policy.
- WorkflowUpdateFailedException
Workflow update failed, but the with-start operation still got a workflow handle.
- RpcException
Server-side error.
ExecuteWorkflowAsync(ITemporalClient, string, IReadOnlyCollection<object?>, WorkflowOptions)
Shortcut for StartWorkflowAsync(string, IReadOnlyCollection<object?>, WorkflowOptions) + GetResultAsync(bool, RpcOptions?).
public static Task ExecuteWorkflowAsync(this ITemporalClient client, string workflow, IReadOnlyCollection<object?> args, WorkflowOptions options)
Parameters
client
ITemporalClientClient to use.
workflow
stringWorkflow type name.
args
IReadOnlyCollection<object>Arguments for the workflow.
options
WorkflowOptionsStart workflow options. ID and TaskQueue are required.
Returns
- Task
Workflow completion task.
Exceptions
- ArgumentException
Invalid options.
- WorkflowAlreadyStartedException
Workflow was already started according to ID reuse policy.
- WorkflowFailedException
Workflow did not complete successfully.
- RpcException
Server-side error.
ExecuteWorkflowAsync<TWorkflow>(ITemporalClient, Expression<Func<TWorkflow, Task>>, WorkflowOptions)
Shortcut for StartWorkflowAsync<TWorkflow>(Expression<Func<TWorkflow, Task>>, WorkflowOptions) + GetResultAsync(bool, RpcOptions?).
public static Task ExecuteWorkflowAsync<TWorkflow>(this ITemporalClient client, Expression<Func<TWorkflow, Task>> workflowRunCall, WorkflowOptions options)
Parameters
client
ITemporalClientClient to use.
workflowRunCall
Expression<Func<TWorkflow, Task>>Invocation of workflow run method without a result.
options
WorkflowOptionsStart workflow options. ID and TaskQueue are required.
Returns
- Task
Workflow result.
Type Parameters
TWorkflow
Workflow class type.
Exceptions
- ArgumentException
Invalid run call or options.
- WorkflowAlreadyStartedException
Workflow was already started according to ID reuse policy.
- WorkflowFailedException
Workflow did not complete successfully.
- RpcException
Server-side error.
ExecuteWorkflowAsync<TResult>(ITemporalClient, string, IReadOnlyCollection<object?>, WorkflowOptions)
Shortcut for StartWorkflowAsync(string, IReadOnlyCollection<object?>, WorkflowOptions) + GetResultAsync<TResult>(bool, RpcOptions?).
public static Task<TResult> ExecuteWorkflowAsync<TResult>(this ITemporalClient client, string workflow, IReadOnlyCollection<object?> args, WorkflowOptions options)
Parameters
client
ITemporalClientClient to use.
workflow
stringWorkflow type name.
args
IReadOnlyCollection<object>Arguments for the workflow.
options
WorkflowOptionsStart workflow options. ID and TaskQueue are required.
Returns
- Task<TResult>
Workflow result.
Type Parameters
TResult
Result type that will be set on the handle.
Exceptions
- ArgumentException
Invalid options.
- WorkflowAlreadyStartedException
Workflow was already started according to ID reuse policy.
- WorkflowFailedException
Workflow did not complete successfully.
- RpcException
Server-side error.
ExecuteWorkflowAsync<TWorkflow, TResult>(ITemporalClient, Expression<Func<TWorkflow, Task<TResult>>>, WorkflowOptions)
Shortcut for StartWorkflowAsync<TWorkflow, TResult>(Expression<Func<TWorkflow, Task<TResult>>>, WorkflowOptions) + GetResultAsync(bool, RpcOptions?).
public static Task<TResult> ExecuteWorkflowAsync<TWorkflow, TResult>(this ITemporalClient client, Expression<Func<TWorkflow, Task<TResult>>> workflowRunCall, WorkflowOptions options)
Parameters
client
ITemporalClientClient to use.
workflowRunCall
Expression<Func<TWorkflow, Task<TResult>>>Invocation of workflow run method with a result.
options
WorkflowOptionsStart workflow options. ID and TaskQueue are required.
Returns
- Task<TResult>
Workflow result.
Type Parameters
TWorkflow
Workflow class type.
TResult
Workflow result type.
Exceptions
- ArgumentException
Invalid run call or options.
- WorkflowAlreadyStartedException
Workflow was already started according to ID reuse policy.
- WorkflowFailedException
Workflow did not complete successfully.
- RpcException
Server-side error.
ListWorkflowHistoriesAsync(ITemporalClient, string, WorkflowListOptions?, WorkflowHistoryEventFetchOptions?)
List workflow histories. This is just a helper combining ListWorkflowsAsync(string, WorkflowListOptions?) and FetchHistoryAsync(WorkflowHistoryEventFetchOptions?).
public static IAsyncEnumerable<WorkflowHistory> ListWorkflowHistoriesAsync(this ITemporalClient client, string query, WorkflowListOptions? listOptions = null, WorkflowHistoryEventFetchOptions? historyFetchOptions = null)
Parameters
client
ITemporalClientClient to use.
query
stringList query.
listOptions
WorkflowListOptionsOptions for the list call.
historyFetchOptions
WorkflowHistoryEventFetchOptionsOptions for each history fetch call.
Returns
- IAsyncEnumerable<WorkflowHistory>
Async enumerable of histories.