DurableTaskReference<TResult>
Namespace: Orleans.Durable.Tasks
DurableTaskGrainExtensions returns. public sealed class DurableTaskReference<TResult> : DurableTask<TResult>, IDurableTaskReference, IDurableTaskSubscriptionRemarks
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
Methods
AbortAsync(string, CancellationToken)Administratively aborts the task, which terminalizes it and its execution tree as failed withDurableTaskAbortedExceptionwithout running further task code.CancelAsync(CancellationToken)Requests durable cancellation of the task.CancelAsync(string?, CancellationToken)Requests durable cancellation of the task carryingreason.GetResponseAsync(CancellationToken)Waits for the task's terminal response.GetResponseAsync(PollingOptions, CancellationToken)Waits for the task's terminal response, polling withoptions.GetStatusAsync(PollingOptions, CancellationToken)Polls the task and returns its current status.IsCompletedAsync(PollingOptions, CancellationToken)Polls the task and returns whether it is terminal.RunAsync(DurableTaskContext)Runs the definition in the supplied execution context.WaitAsync(CancellationToken)Waits for the task's successful result.
