Skip to content

IScheduledTaskHandle Methods

Controls and observes one scheduled durable task.

AbortAsync(string, CancellationToken)

virtual
View source
public virtual ValueTask AbortAsync(string reason, CancellationToken cancellationToken)
Administratively aborts the task: the host terminalizes it and its attached descendants as failed with DurableTaskAbortedException, without running further task code. The token abandons waiting for acknowledgement.

Parameters

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

CancelAsync(string?, CancellationToken)

abstract
View source
public abstract ValueTask CancelAsync(string? reason, CancellationToken cancellationToken)
Durably requests task cancellation carrying reason. The request is monotonic and idempotent. The token abandons waiting for acknowledgement.

Parameters

reasonstring?
The reason which the task's DurableTaskContext reports, or null for none.
cancellationTokenCancellationToken
A token which abandons waiting for the request to commit.

CancelAsync(CancellationToken)

virtual
View source
public virtual ValueTask CancelAsync(CancellationToken cancellationToken)
Durably requests task cancellation without a reason. The request is monotonic and idempotent. The token abandons waiting for acknowledgement.

Parameters

cancellationTokenCancellationToken

GetFeature

virtual
View source
public virtual TFeature? GetFeature<TFeature>()
Returns the feature TFeature through which the host describes the task, or null; see ScheduledTask.

PollAsync(PollingOptions, CancellationToken)

abstract
public abstract ValueTask<DurableTaskResponse> PollAsync(PollingOptions options, CancellationToken cancellationToken)
Observes the current response. Canceling cancellationToken cancels this poll.

Parameters

optionsPollingOptions
cancellationTokenCancellationToken

WaitAsync(CancellationToken)

abstract
public abstract ValueTask<DurableTaskResponse> WaitAsync(CancellationToken cancellationToken)
Waits for a terminal response. Canceling cancellationToken cancels this wait.

Parameters

cancellationTokenCancellationToken