Language

TaskDefinition<TInput,TOutput>.DeleteAsync Method

Definition

Ends a multi-turn chain: cancels any in-flight turn, resolves queued callers as cancelled, and removes the record. Idempotent β€” a no-op when the chain is absent.

public virtual System.Threading.Tasks.Task DeleteAsync(string taskId, System.Threading.CancellationToken cancellationToken = default);
abstract member DeleteAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.DeleteAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function DeleteAsync (taskId As String, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

taskId
String

The chain id.

cancellationToken
CancellationToken

A cancellation token.

Returns

A task that completes when the chain has been removed.

Remarks

Cancellation is requested before storage deletion. A storage failure does not undo cancellation and does not authorize stream closure. Task-bound streams close after deletion is confirmed and their producer has unwound. This method does not wait for an in-flight handler to finish; that handler's completion may remain pending.

Applies to