Skip to content

IDurableTaskManager Methods

Observes and controls the durable tasks of the current durable grain activation, without a grain call.

AbortAsync(TaskId, string, CancellationToken)

abstract
View source
public abstract ValueTask AbortAsync(TaskId taskId, string reason, CancellationToken cancellationToken = default(CancellationToken))
Administratively aborts a task of this grain: commits the task and its execution tree as failed with DurableTaskAbortedException in one write, and stops their running attempts without running further task code.

Parameters

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

Returns

An operation which completes once the abort has committed.

AbortAsync(string, string, CancellationToken)

virtual
View source
public virtual ValueTask AbortAsync(string rootId, string reason, CancellationToken cancellationToken = default(CancellationToken))
Administratively aborts the root task rootId of this grain and its execution tree.

Parameters

rootIdstring
The root task's identifier, as passed to TaskId.
reasonstring
The reason for the abort, recorded as the exception message.
cancellationTokenCancellationToken
A token which abandons waiting for the abort to commit.

Returns

An operation which completes once the abort has committed.

CancelAsync(TaskId, string?, CancellationToken)

abstract
View source
public abstract ValueTask CancelAsync(TaskId taskId, string? reason, CancellationToken cancellationToken = default(CancellationToken))
Durably requests cancellation of a task of this grain and its execution tree, carrying reason.

Parameters

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

Returns

An operation which completes once the cancellation request has committed and propagated.

Exceptions

Orleans.Durable.Tasks.DurableTaskNotFoundException
This grain doesn't retain the task.

CancelAsync(TaskId, CancellationToken)

virtual
View source
public virtual ValueTask CancelAsync(TaskId taskId, CancellationToken cancellationToken = default(CancellationToken))
Durably requests cancellation of a task of this grain and its execution tree.

Parameters

taskIdTaskId
The task identifier.
cancellationTokenCancellationToken
A token which abandons waiting for the request to commit.

Returns

An operation which completes once the cancellation request has committed and propagated.

CancelAsync(string, CancellationToken)

virtual
View source
public virtual ValueTask CancelAsync(string rootId, CancellationToken cancellationToken = default(CancellationToken))
Durably requests cancellation of the root task rootId of this grain and its execution tree.

Parameters

rootIdstring
The root task's identifier, as passed to TaskId.
cancellationTokenCancellationToken
A token which abandons waiting for the request to commit.

Returns

An operation which completes once the cancellation request has committed and propagated.

CancelAsync(string, string?, CancellationToken)

virtual
View source
public virtual ValueTask CancelAsync(string rootId, string? reason, CancellationToken cancellationToken = default(CancellationToken))
Durably requests cancellation of the root task rootId of this grain and its execution tree, carrying reason.

Parameters

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

Returns

An operation which completes once the cancellation request has committed and propagated.

GetTask(TaskId)

abstract
View source
public abstract ScheduledTask GetTask(TaskId taskId)
Gets a handle which observes or cancels an existing task of this grain.

Parameters

taskIdTaskId
The task identifier.

Returns

A handle for the task. Polling or waiting for a task which this grain doesn't retain throws DurableTaskNotFoundException.

GetTask(TaskId)

abstract
View source
public abstract ScheduledTask<TResult> GetTask<TResult>(TaskId taskId)
Gets a typed handle which observes or cancels an existing task of this grain.

Parameters

taskIdTaskId
The task identifier.

Returns

A handle for the task. Polling or waiting for a task which this grain doesn't retain throws DurableTaskNotFoundException.

GetTask(string)

virtual
View source
public virtual ScheduledTask GetTask(string rootId)
Gets a handle which observes or cancels the existing root task rootId of this grain.

Parameters

rootIdstring
The root task's identifier, as passed to TaskId.

Returns

A handle for the task, as IDurableTaskManager returns.

GetTask(string)

virtual
View source
public virtual ScheduledTask<TResult> GetTask<TResult>(string rootId)
Gets a typed handle which observes or cancels the existing root task rootId of this grain.

Parameters

rootIdstring
The root task's identifier, as passed to TaskId.

Returns

A handle for the task, as IDurableTaskManager returns.

SignalAsync(TaskId, DurableSignal<T>, T, CancellationToken)

abstract
View source
public abstract ValueTask SignalAsync<T>(TaskId taskId, DurableSignal<T> signal, T value, CancellationToken cancellationToken = default(CancellationToken))
Delivers signal with value to an invoked task of this grain.

Parameters

taskIdTaskId
The identifier of a task which a client or another grain invoked on this grain.
signalDurableSignal<T>
The signal descriptor which the task's waits share.
valueT
The signal's value.
cancellationTokenCancellationToken
A token which abandons waiting for the signal to commit.

Returns

An operation which completes once the signal commits with this grain's pending state changes.

Exceptions

Orleans.Durable.Tasks.DurableTaskNotFoundException
This grain retains no invoked task taskId.
System.InvalidOperationException
The task holds a different value for the signal, or it is terminal and holds no value for the signal.

SignalAsync(string, DurableSignal<T>, T, CancellationToken)

virtual
View source
public virtual ValueTask SignalAsync<T>(string rootId, DurableSignal<T> signal, T value, CancellationToken cancellationToken = default(CancellationToken))
Delivers signal with value to the invoked root task rootId of this grain.

Parameters

rootIdstring
The root task's identifier, as passed to TaskId.
signalDurableSignal<T>
The signal descriptor which the task's waits share.
valueT
The signal's value.
cancellationTokenCancellationToken
A token which abandons waiting for the signal to commit.

Returns

An operation which completes once the signal commits with this grain's pending state changes.

TrySignalAsync(TaskId, DurableSignal<T>, T, CancellationToken)

abstract
View source
public abstract ValueTask<DurableSignalResult> TrySignalAsync<T>(TaskId taskId, DurableSignal<T> signal, T value, CancellationToken cancellationToken = default(CancellationToken))
Delivers signal with value to an invoked task of this grain, and returns how the task handled it.

Parameters

taskIdTaskId
The identifier of a task which a client or another grain invoked on this grain.
signalDurableSignal<T>
The signal descriptor which the task's waits share.
valueT
The signal's value.
cancellationTokenCancellationToken
A token which abandons waiting for the signal to commit.

Returns

DurableSignalResult or DurableSignalResult once the task durably holds the value, or the reason the task rejected it, which changes nothing.

TrySignalAsync(string, DurableSignal<T>, T, CancellationToken)

virtual
View source
public virtual ValueTask<DurableSignalResult> TrySignalAsync<T>(string rootId, DurableSignal<T> signal, T value, CancellationToken cancellationToken = default(CancellationToken))
Delivers signal with value to the invoked root task rootId of this grain, and returns how the task handled it.

Parameters

rootIdstring
The root task's identifier, as passed to TaskId.
signalDurableSignal<T>
The signal descriptor which the task's waits share.
valueT
The signal's value.
cancellationTokenCancellationToken
A token which abandons waiting for the signal to commit.

Returns

The task's handling of the signal, as IDurableTaskManager returns.