Struct PreferredNode
- Namespace
- Quartz
- Assembly
- Quartz.dll
Which cluster node a trigger prefers to run on.
public readonly record struct PreferredNode : IEquatable<PreferredNode>
- Implements
- Inherited Members
Remarks
A trigger is either unpinned (None, the default), pinned to a node the caller names (For(string)), or pinned to whichever node fires it first (Auto). An automatic pin stays automatic once claimed: it is released back to the pool when its node stops checking in, whereas a named pin is kept and simply fails over while that node is down.
The node name is a scheduler instance id (matching quartz.scheduler.instanceId) and has
to match it exactly — pin comparisons happen in SQL using the database's string collation, so a
value differing only in case is a different (and on case-sensitive databases, never-matching)
node.
Properties
Auto
Pin the trigger to whichever node fires it first, and keep it there for as long as that node is alive.
public static PreferredNode Auto { get; }
Property Value
IsAutomatic
Whether the pin is (or, once claimed, was) handed out automatically rather than named by the caller. An automatic pin is released when its node stops checking in.
public bool IsAutomatic { get; }
Property Value
IsNone
Whether the trigger has no node preference at all.
public bool IsNone { get; }
Property Value
Node
The scheduler instance id the trigger is pinned to, or null when it has no pin or is still waiting for a node to claim an Auto pin.
public string? Node { get; }
Property Value
None
No preference: any node in the cluster may fire the trigger. The default.
public static PreferredNode None { get; }
Property Value
Methods
For(string)
Pin the trigger to the node with the given scheduler instance id.
public static PreferredNode For(string node)
Parameters
nodestringThe scheduler instance id of the target node, matching
quartz.scheduler.instanceId.
Returns
Exceptions
- ArgumentNullException
nodeis null.- ArgumentException
nodeis blank or is a name reserved by the pinning protocol. Use None to clear a pin and Auto to request one.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.