Azure / durabletask

Durable Task Framework allows users to write long running persistent workflows in C# using the async/await capabilities.
Apache License 2.0
1.53k stars 296 forks source link

how to clean timer orchestration creates via CreateTimer() in durable task framework? #1041

Open kikeshar opened 9 months ago

kikeshar commented 9 months ago

We are using the timer function provided by DTF to support periodic workflow like below.

TResult result = default(TResult) !; try { result = await base.RunTask(context, input); } catch (Exception) { } finally { await context.CreateTimer(DateTime.UtcNow.Add(this.Periodicity), null !); context.ContinueAsNew(input); }

return result;

Now we want to clean up the orchestration scheduled by timer and create schedule at new timing. what is the best way to clean up this orchestration? for Using TerminateAsync , the workflow might be in run, so intention is to stop it after current run.