Skip to content

DurableTaskReference<TResult>

class

Namespace: Orleans.Durable.Tasks

A reference to an existing durable task of a grain, which DurableTaskGrainExtensions returns.
public sealed class DurableTaskReference<TResult> : DurableTask<TResult>, IDurableTaskReference, IDurableTaskSubscription

Remarks

In a durable execution, the reference is a durable task definition: awaiting it, scheduling it, or passing it to a combinator subscribes a child of the execution to the task's result, which the execution records for replay.

Outside a durable execution, awaiting the reference waits for the task's result, and its polling members, such as Orleans.Durable.Tasks.DurableTaskReference.GetResponseAsync, Orleans.Durable.Tasks.DurableTaskReference.WaitAsync, and Orleans.Durable.Tasks.DurableTaskReference.GetStatusAsync, and its control members, Orleans.Durable.Tasks.DurableTaskReference.CancelAsync and Orleans.Durable.Tasks.DurableTaskReference.AbortAsync, call the task's grain. Waits and polls retry the failures which leave the task unaffected, such as a lost connection, a crashed silo, or a deactivating activation, until the grain answers or the caller's token ends them. A durable execution doesn't record those calls.

The reference is awaitable through DurableTaskReferenceExtensions, an extension method, so frameworks which inspect a return type's instance members, such as ASP.NET Core Minimal APIs, treat the reference as a value. IDurableTaskReference reads its Orleans.Durable.Tasks.DurableTaskReference.Target and Orleans.Durable.Tasks.DurableTaskReference.Id without its result type.

Properties

  • AddressGets the address of the referenced task, which code stores or sends to reach the task later.
  • IdGets the identifier of the referenced task.
  • TargetGets the grain which owns the referenced task.

Methods