[Workflows] Expose CancellationToken as part of RunAsync
- Dominant language
- C#
- Stars
- 1.2k
- Forks
- 378
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 6
Description
## Describe the feature
Currently the `CancellationToken` isn't exposed by the `RunAsync` abstract method. Traditionally, async methods include the token to be passed to subsequent `async` calls.
While there isn't currently any support for cancellation tokens, there is discussion about introducing them in the future. Since including it as part of the method signature would be a breaking change, it would make sense to introduce it at this time, during the beta period, in preparation for future use. A `CancellationToken.None` can be passed for the time being.
The run method signatures should look like the following for workflows and activities respectively, with the interfaces also being modified accordingly.
```
public abstract class Workflow : IWorkflow
{
public abstract Task RunAsync(WorkflowContext context, TInput input, CancellationToken cancellationToken);
}
public abstract class WorkflowActivity : IWorkflowActivity
{
public abstract Task RunAsync(WorkflowActivityContext context, TInput input), CancellationToken cancellationToken);
}
Contributor guide
Assessment
This issue has not been assessed yet.