Table of Contents

Class SchedulerRegistration

Namespace
Quartz
Assembly
Quartz.dll

One scheduler a container knows about, as reported by QuerySchedulers(CancellationToken).

public sealed record SchedulerRegistration : IEquatable<SchedulerRegistration>
Inheritance
SchedulerRegistration
Implements
Inherited Members

Constructors

SchedulerRegistration(string, SchedulerOrigin, SchedulerStatus?)

One scheduler a container knows about, as reported by QuerySchedulers(CancellationToken).

public SchedulerRegistration(string Name, SchedulerOrigin Origin, SchedulerStatus? Status)

Parameters

Name string

The scheduler's name, spelled as it was registered. For a named registration this is the name AddQuartz(name, …) was given, which is also the service key and the options name; for the default scheduler it is its configured InstanceName.

Origin SchedulerOrigin

Where the scheduler came from.

Status SchedulerStatus?

What state the scheduler is in, or null when no scheduler exists under this name. Null is the answer this query exists to give: the registration is there, nothing has been built from it, and asking did not build it.

A scheduler that has been shut down also reads as null rather than as Shutdown, because ISchedulerRepository drops a shut-down scheduler as soon as a read notices it. So null means "no live scheduler under this name" — for a registration, either not yet or not any more. The two are not worth telling apart here: a shut-down scheduler cannot be created again within the same container, so neither is a name you can get a working scheduler out of.

Properties

IsCreated

Whether a scheduler exists under this name. A registration nothing has resolved yet reports false; Status says what state a scheduler that does exist is in.

public bool IsCreated { get; }

Property Value

bool

Key

target/name, or the bare name when there is no target: what a dashboard's picker holds and what every scheduler-scoped member of its client takes. Added in 4.5.

public string Key { get; }

Property Value

string

LastSeenUtc

When the process behind an Agent last spoke to this one, or null for every scheduler whose liveness is asked rather than heard. Added in 4.5.

public DateTimeOffset? LastSeenUtc { get; init; }

Property Value

DateTimeOffset?

Members

The targets a Cluster is made of, sorted; empty for every other origin. Added in 4.5.

public string[] Members { get; init; }

Property Value

string[]

Name

The scheduler's name, spelled as it was registered. For a named registration this is the name AddQuartz(name, …) was given, which is also the service key and the options name; for the default scheduler it is its configured InstanceName.

public string Name { get; init; }

Property Value

string

Origin

Where the scheduler came from.

public SchedulerOrigin Origin { get; init; }

Property Value

SchedulerOrigin

SchedulerInstanceId

The instance id of the scheduler behind this registration, or null when nothing has built one — or when the one that exists could not be asked.

public string? SchedulerInstanceId { get; init; }

Property Value

string

Remarks

Carried by the registration rather than read back off the scheduler, because reading it off a scheduler in another process is a round trip that blocks the thread doing it. This one was asked for asynchronously, under the same deadline Status was, so a listing costs at most one bounded wait however unreachable its targets are.

Status

What state the scheduler is in, or null when no scheduler exists under this name. Null is the answer this query exists to give: the registration is there, nothing has been built from it, and asking did not build it.

A scheduler that has been shut down also reads as null rather than as Shutdown, because ISchedulerRepository drops a shut-down scheduler as soon as a read notices it. So null means "no live scheduler under this name" — for a registration, either not yet or not any more. The two are not worth telling apart here: a shut-down scheduler cannot be created again within the same container, so neither is a name you can get a working scheduler out of.

public SchedulerStatus? Status { get; init; }

Property Value

SchedulerStatus?

Target

The target this scheduler is reached through, or null for a scheduler reached through none.

public string? Target { get; init; }

Property Value

string

Remarks

Set for every scheduler reached through a target: the store a Window is onto — AttachStore("prod", …) — the HttpClientOptions.Target of a Remote registration that gave one, the name an Agent registered under, and the a+b+c of a Cluster. Together with Name it is the scheduler's identity, spelled prod/reporting wherever one is shown and parsed by SchedulerRef. A scheduler of this process, and one AddQuartzHttpClient registered without a target, has no target and keeps its bare name, so nothing that existed before reads differently.

The name is the scheduler's own, as its process spells it: the target says where the name was found, and two targets may hold a scheduler of the same name.