Skip to content

DurableTaskAddressExtensions Methods

Creates and resolves the addresses of durable tasks.

GetDurableTask(IGrainFactory, DurableTaskAddress)

staticextension
View source
public static DurableTaskReference<TResult> GetDurableTask<TResult>(this IGrainFactory grainFactory, DurableTaskAddress address)
Gets a reference to the durable task at address, without scheduling it.

Parameters

grainFactoryIGrainFactory
The grain factory, such as a grain's GrainFactory or an IClusterClient.
addressDurableTaskAddress
The task's address.

Returns

A reference which behaves as DurableTaskGrainExtensions describes.

Exceptions

System.ArgumentNullException
grainFactory is null.
System.ArgumentException
address has no grain or no task identifier.

TryGetAddress(ScheduledTask, DurableTaskAddress)

staticextension
View source
public static bool TryGetAddress(this ScheduledTask task, out DurableTaskAddress address)
Gets the address of the task which task observes, when other parties reach it.

Parameters

taskScheduledTask
The handle.
addressDurableTaskAddress
The address of the task, when this method returns true.

Returns

true when the handle's task is one which its grain retains for other parties: a root task which a client or an ordinary grain method started, or, in a durable execution, a detached task or a task which GetDurableTask observes. An attached child, which the execution's tree owns, has no address.

Exceptions

System.ArgumentNullException
task is null.