Skip to content

ScheduledTask.AbortAsync(string, CancellationToken)

AbortAsync(string, CancellationToken)

View source
public ValueTask AbortAsync(string reason, CancellationToken cancellationToken = default(CancellationToken))
Administratively aborts the task: the host terminalizes it and its attached descendants as failed with a DurableTaskAbortedException carrying reason, without running further task code.

Parameters

reasonstring
The reason for the abort, recorded as the exception message.
cancellationTokenCancellationToken
A token which abandons waiting for the abort to commit.

Exceptions

System.ArgumentException
reason is null, empty, or whitespace.
System.NotSupportedException
The host doesn't support aborting tasks.