Class TriggerMetadata
A trigger's metadata (openspec groups-and-topology, design decision 2): what changes without rescheduling its Dapr job. Stored as JSON under TriggerMetadataKey(string).
public sealed record TriggerMetadata : IEquatable<TriggerMetadata>
- Inheritance
-
TriggerMetadata
- Implements
- Inherited Members
Constructors
TriggerMetadata(string, string?, SortedDictionary<string, string>, IReadOnlyList<string>, bool, long, string, int)
A trigger's metadata (openspec groups-and-topology, design decision 2): what changes without rescheduling its Dapr job. Stored as JSON under TriggerMetadataKey(string).
public TriggerMetadata(string Id, string? OwnerWorkerId, SortedDictionary<string, string> Tags, IReadOnlyList<string> Groups, bool Deleting, long CreatedMs, string ScheduleToken, int Fired = 0)
Parameters
IdstringThe trigger's id (also its Dapr job's name).
OwnerWorkerIdstringThe worker it exists for, or null.
TagsSortedDictionary<string, string>Its tags.
GroupsIReadOnlyList<string>The groups it belongs to, sorted.
DeletingboolIts last group was removed (
RemoveTriggerFromGroup) and the caller is deleting it: it keeps that group, so a repeated group deletion finds it again, and it can join no group.CreatedMslongWhen the record was created, Unix milliseconds.
ScheduleTokenstringThe token of the
ScheduleTriggercall that created it, also in its job's data: a job whose token differs was not scheduled by this record's create.FiredintHow often the job has fired, counted only for a job that fires a finite number of times (Virtufin.Api.Services.TriggerJobData.FieldFirings), so its last firing deletes the record.
Properties
CreatedMs
When the record was created, Unix milliseconds.
[JsonPropertyName("created_ms")]
public long CreatedMs { get; init; }
Property Value
Deleting
Its last group was removed (RemoveTriggerFromGroup) and the caller is deleting it:
it keeps that group, so a repeated group deletion finds it again, and it can join no group.
[JsonPropertyName("deleting")]
public bool Deleting { get; init; }
Property Value
Fired
How often the job has fired, counted only for a job that fires a finite number of times (Virtufin.Api.Services.TriggerJobData.FieldFirings), so its last firing deletes the record.
[JsonPropertyName("fired")]
public int Fired { get; init; }
Property Value
Groups
The groups it belongs to, sorted.
[JsonPropertyName("groups")]
public IReadOnlyList<string> Groups { get; init; }
Property Value
Id
The trigger's id (also its Dapr job's name).
[JsonPropertyName("id")]
public string Id { get; init; }
Property Value
OwnerWorkerId
The worker it exists for, or null.
[JsonPropertyName("owner_worker_id")]
public string? OwnerWorkerId { get; init; }
Property Value
ScheduleToken
The token of the ScheduleTrigger call that created it, also in its job's data: a
job whose token differs was not scheduled by this record's create.
[JsonPropertyName("schedule_token")]
public string ScheduleToken { get; init; }
Property Value
Tags
Its tags.
[JsonPropertyName("tags")]
public SortedDictionary<string, string> Tags { get; init; }
Property Value
Methods
Empty(string, long)
The record of a trigger whose job has none (scheduled before records existed): no tags, groups or owner.
public static TriggerMetadata Empty(string id, long createdMs)