Skip to content

ConfiguredDurableTask<TResult> Methods

Configures and starts a durable task with a result.

Detached

View source
public ConfiguredDurableTask<TResult> Detached()
Returns a configuration which starts the task as an independent root task.

Detached(string)

View source
public ConfiguredDurableTask<TResult> Detached(string rootId)
Returns a configuration which starts the task as the independent root task rootId.

Parameters

rootIdstring
The definition to start, such as a durable grain call.

Exceptions

System.InvalidOperationException
This configuration already has an identifier.
System.ArgumentException
rootId is null or empty.

GetAwaiter

View source
public DurableTaskAwaiter<TResult> GetAwaiter()
Gets an awaiter which runs or attaches to the task and returns its result once the result is durable.

Post

View source
public ScheduledTask<TResult> Post()
Stages the start of the task in the caller's durable outbox, and returns its handle without waiting.

Returns

The task's handle, which the caller can await later.

Exceptions

System.InvalidOperationException
The caller has no durable outbox, for example because it's a client.

ScheduleAsync(CancellationToken)

View source
public Task<ScheduledTask<TResult>> ScheduleAsync(CancellationToken cancellationToken = default(CancellationToken))
Starts the task and returns its handle once the task's host has accepted and durably stored the task.

Parameters

cancellationTokenCancellationToken
A token which abandons the start. It doesn't cancel the task.

Returns

The task's handle, whose ScheduledTask addresses the task.

Shielded

View source
public ConfiguredDurableTask<TResult> Shielded()
Returns a configuration which starts the task as an attached child, or runs it as part of the execution, out of reach of the starting execution's durable cancellation.

WithId(string)

View source
public ConfiguredDurableTask<TResult> WithId(string name)
Returns a configuration which names the task.

Parameters

namestring
The definition to start.

Exceptions

System.InvalidOperationException
This configuration already has an identifier.