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
clientITemporalClientClient to use.
updatestringName of the update.
argsIReadOnlyCollection<object>Arguments for the update.
optionsWorkflowUpdateWithStartOptionsUpdate options.
Returns
- Task
Completed update task.
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
clientITemporalClientClient to use.
updateCallExpression<Func<TWorkflow, Task>>Invocation of workflow update method.
optionsWorkflowUpdateWithStartOptionsUpdate options.
Returns
- Task
Completed update task.
Type Parameters
TWorkflowWorkflow class type.
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
clientITemporalClientClient to use.
updatestringName of the update.
argsIReadOnlyCollection<object>Arguments for the update.
optionsWorkflowUpdateWithStartOptionsUpdate options.
Returns
- Task<TUpdateResult>
Completed update task.
Type Parameters
TUpdateResultUpdate result type.
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
clientITemporalClientClient to use.
updateCallExpression<Func<TWorkflow, Task<TUpdateResult>>>Invocation of workflow update method.
optionsWorkflowUpdateWithStartOptionsUpdate options.
Returns
- Task<TUpdateResult>
Completed update task.
Type Parameters
TWorkflowWorkflow class type.
TUpdateResultUpdate result type.
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
clientITemporalClientClient to use.
workflowstringWorkflow type name.
argsIReadOnlyCollection<object>Arguments for the workflow.
optionsWorkflowOptionsStart 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
clientITemporalClientClient to use.
workflowRunCallExpression<Func<TWorkflow, Task>>Invocation of workflow run method without a result.
optionsWorkflowOptionsStart workflow options. ID and TaskQueue are required.
Returns
- Task
Workflow result.
Type Parameters
TWorkflowWorkflow 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
clientITemporalClientClient to use.
workflowstringWorkflow type name.
argsIReadOnlyCollection<object>Arguments for the workflow.
optionsWorkflowOptionsStart workflow options. ID and TaskQueue are required.
Returns
- Task<TResult>
Workflow result.
Type Parameters
TResultResult 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
clientITemporalClientClient to use.
workflowRunCallExpression<Func<TWorkflow, Task<TResult>>>Invocation of workflow run method with a result.
optionsWorkflowOptionsStart workflow options. ID and TaskQueue are required.
Returns
- Task<TResult>
Workflow result.
Type Parameters
TWorkflowWorkflow class type.
TResultWorkflow 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
clientITemporalClientClient to use.
querystringList query.
listOptionsWorkflowListOptionsOptions for the list call.
historyFetchOptionsWorkflowHistoryEventFetchOptionsOptions for each history fetch call.
Returns
- IAsyncEnumerable<WorkflowHistory>
Async enumerable of histories.