Table of Contents

Struct Continuation

Namespace
Quartz
Assembly
Quartz.dll

Which trigger's firing a trigger waits for, and on which outcomes of it the wait ends.

public readonly record struct Continuation : IEquatable<Continuation>
Implements
Inherited Members

Remarks

A trigger carrying a continuation is stored in Awaiting and is never acquired while it is there. The parent's completion settles it, inside the parent's own lock and transaction: a matching outcome releases the trigger into the ordinary schedule, and any other outcome deletes it. Whichever node completes the parent is the node that settles, so a continuation survives the failure of the node that scheduled it. A one-shot parent lost with the node running it is deleted by cluster recovery, so its continuations are settled as for a deleted parent, and the recovery firing — under a key of its own — settles nothing.

The parent is a TriggerKey rather than a JobKey because a continuation waits for one firing, and a job may be fired by several triggers. The one-call scheduling overloads answer with the key to use as TriggerKey.

StartTimeUtc stays a floor rather than a schedule: releasing a continuation sets its next fire time to the later of "now" and its start time, so "an hour after the import, and never before nine" is expressible. A calendar the trigger names moves that instant on to the next one it includes, and a continuation whose EndTimeUtc is behind it by then is discarded rather than released.

Constructors

Continuation(TriggerKey?, ContinuationCondition)

Which trigger's firing a trigger waits for, and on which outcomes of it the wait ends.

public Continuation(TriggerKey? Parent, ContinuationCondition When)

Parameters

Parent TriggerKey

The trigger whose firing this one waits for, or null when the trigger waits for nothing.

When ContinuationCondition

The outcomes of that firing which release the wait.

Remarks

A trigger carrying a continuation is stored in Awaiting and is never acquired while it is there. The parent's completion settles it, inside the parent's own lock and transaction: a matching outcome releases the trigger into the ordinary schedule, and any other outcome deletes it. Whichever node completes the parent is the node that settles, so a continuation survives the failure of the node that scheduled it. A one-shot parent lost with the node running it is deleted by cluster recovery, so its continuations are settled as for a deleted parent, and the recovery firing — under a key of its own — settles nothing.

The parent is a TriggerKey rather than a JobKey because a continuation waits for one firing, and a job may be fired by several triggers. The one-call scheduling overloads answer with the key to use as TriggerKey.

StartTimeUtc stays a floor rather than a schedule: releasing a continuation sets its next fire time to the later of "now" and its start time, so "an hour after the import, and never before nine" is expressible. A calendar the trigger names moves that instant on to the next one it includes, and a continuation whose EndTimeUtc is behind it by then is discarded rather than released.

See Also

Properties

IsNone

Whether the trigger waits for nothing, which is what a trigger with an ordinary schedule carries.

public bool IsNone { get; }

Property Value

bool

None

No continuation: the trigger fires on its own schedule and waits for nothing. The default.

public static Continuation None { get; }

Property Value

Continuation

Parent

The trigger whose firing this one waits for, or null when the trigger waits for nothing.

public TriggerKey? Parent { get; init; }

Property Value

TriggerKey

When

The outcomes of that firing which release the wait.

public ContinuationCondition When { get; init; }

Property Value

ContinuationCondition

Methods

After(TriggerKey, ContinuationCondition)

Wait for the given trigger's firing, and be released when it ends in one of the named ways.

public static Continuation After(TriggerKey parent, ContinuationCondition condition = ContinuationCondition.OnSuccess)

Parameters

parent TriggerKey

The trigger whose firing to wait for.

condition ContinuationCondition

The outcomes that release the wait. Any other outcome discards the continuation, so OnSuccess — the default — means "run this only if that one worked".

Returns

Continuation

Remarks

The parent has to be in the store when the trigger carrying this is stored, or the store refuses it with ObjectDoesNotExistException naming both keys. A one-shot parent is deleted once it has fired, so schedule the continuation before the parent can finish, or check the parent's key.

Exceptions

ArgumentNullException

parent is null.

ArgumentOutOfRangeException

condition names no outcome at all, or names a value that is not an outcome. A condition nothing satisfies would discard the continuation whatever the parent did, which is a schedule nobody means to write.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

See Also