Azure / Azure/durabletask

Support Graceful Termination of Orchestrations and Activities using CancellationToken

Open
#784 5 comments 3 reactions 0 assignees View on GitHub
dt.core enhancement
Dominant language
C#
Stars
1.7k
Forks
335
Avg merge
2d 23h
Merged PRs (30d)
6

Description

Similar to #565 , it would be greate if TaskActivities/TaskOrchestrations could be dispatched with a developer-provided cancellation token.

For example, if we could provide a cancellation token as part of `StartAsync` on a single worker node, that can be propagated to dispatched orchestrations/activities to allow developers have more control over termination of running activities/orchestrations.

```c#
taskHubWorker.StartAsync(cancellationToken);
```

An example use case would be interface activities:

```c#
public interface IInterfaceTask
{
Task WorkAsync(CancellationToken cancellationToken);
}

public class Orchestration : TaskOrchestration
{
public Task RunTask(OrchestrationContext context, bool input)
{
var interfaceTask = context.CreateClient();
await interfaceTask.WorkAsync(context.CancellationToken);
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.