ScheduledTask
class
Namespace: Orleans.Durable.Tasks
Represents a host-scheduled durable task.
public abstract class ScheduledTaskRemarks
A handle caches the task's terminal response once a wait, a poll, or a combinator observes it. A terminal response never changes, so
ScheduledTask, ScheduledTask, and ScheduledTask then inspect the task synchronously, without contacting the host. Properties
ExceptionGets the recorded failure or cancellation of a task which failed or was canceled, once this handle has observed its terminal response; otherwisenull.IdGets the stable durable task identifier.IsCompletedGets whether this handle has observed the task's terminal response.StatusGets the terminal status which this handle observed, orDurableTaskStatusuntil it observes the terminal response.TargetTaskIdGets the identifier under which the task's host stores the task which this handle observes, which other parties use to address the task.
Methods
AbortAsync(string, CancellationToken)Administratively aborts the task: the host terminalizes it and its attached descendants as failed with aDurableTaskAbortedExceptioncarryingreason, without running further task code.AbortAsyncCore(string, CancellationToken)Asks the host to abort the task for a validatedreason.CancelAsync(CancellationToken)Durably requests cancellation.CancelAsync(string?, CancellationToken)Durably requests cancellation carryingreason.CancelAsyncCore(string?, CancellationToken)Asks the host to cancel the task carryingreason, or no reason when it isnull.GetAwaiterGets an awaiter which waits for successful completion.GetFeatureReturns the featureTFeaturethrough which the task's host describes the task, ornullwhen the host provides none.GetResponseAsync(CancellationToken)Waits for and returns the terminal response.GetResponseAsync(PollingOptions, CancellationToken)Polls and returns the current response.GetStatusAsync(PollingOptions, CancellationToken)Polls the current task status.IsCompletedAsync(PollingOptions, CancellationToken)Polls whether the task has reached a terminal state.PollAsyncCore(PollingOptions, CancellationToken)Polls the current host response.Race(IReadOnlyList<ScheduledTask<TResult>>, CancellationToken)Waits for the first scheduled task to complete, requests durable cancellation of every other task, waits until every task is terminal, and returns the first task.Race(IReadOnlyList<ScheduledTask>, CancellationToken)Waits for the first scheduled task to complete, requests durable cancellation of every other task, waits until every task is terminal, and returns the first task.WaitAsync(TimeSpan, CancellationToken)Waits for successful completion, and requests durable cancellation of the task oncetimeoutelapses.WaitAsync(CancellationToken)Waits for successful completion.WaitAsyncCore(CancellationToken)Waits for a terminal host response.WaitUntilAsync(DateTimeOffset, CancellationToken)Waits for successful completion, and requests durable cancellation of the task oncedueTimepasses.WhenAll(IReadOnlyList<ScheduledTask>, CancellationToken)Waits for every scheduled task to complete successfully.WhenAll(IReadOnlyList<ScheduledTask<TResult>>, CancellationToken)Waits for every scheduled task to complete successfully.WhenAllCompleted(IReadOnlyList<ScheduledTask<TResult>>, CancellationToken)Waits until every scheduled task is terminal, and returns the tasks in input order.WhenAllCompleted(IReadOnlyList<ScheduledTask>, CancellationToken)Waits until every scheduled task is terminal, and returns the tasks in input order.WhenAny(IReadOnlyList<ScheduledTask<TResult>>, CancellationToken)Returns the first scheduled task whose response completes, including failed or canceled durable responses. Wait cancellation and transport failures are propagated, and losing waits are canceled without canceling the durable tasks. Candidates are captured when this method is called.WhenAny(IReadOnlyList<ScheduledTask>, CancellationToken)Returns the first scheduled task whose response completes, including failed or canceled durable responses. Wait cancellation and transport failures are propagated, and losing waits are canceled without canceling the durable tasks. Candidates are captured when this method is called.WhenEach(IReadOnlyList<ScheduledTask<TResult>>)Yields each scheduled task once, in completion order, as it reaches a terminal state.WhenEach(IReadOnlyList<ScheduledTask>)Yields each scheduled task once, in completion order, as it reaches a terminal state.
