Class ITemporalClientExtensions
- Namespace
- Temporalio.Client
- Assembly
- Temporalio.dll
Extensions for ITemporalClient.
public static class ITemporalClientExtensions
- Inheritance
-
ITemporalClientExtensions
- Inherited Members
Methods
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.