Table of Contents

Class TriggerMetadata

Namespace
Virtufin.Api.Services
Assembly
Virtufin.Api.dll

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

Id string

The trigger's id (also its Dapr job's name).

OwnerWorkerId string

The worker it exists for, or null.

Tags SortedDictionary<string, string>

Its tags.

Groups IReadOnlyList<string>

The groups it belongs to, sorted.

Deleting bool

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.

CreatedMs long

When the record was created, Unix milliseconds.

ScheduleToken string

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.

Fired int

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.

Properties

CreatedMs

When the record was created, Unix milliseconds.

[JsonPropertyName("created_ms")]
public long CreatedMs { get; init; }

Property Value

long

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

bool

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

int

Groups

The groups it belongs to, sorted.

[JsonPropertyName("groups")]
public IReadOnlyList<string> Groups { get; init; }

Property Value

IReadOnlyList<string>

Id

The trigger's id (also its Dapr job's name).

[JsonPropertyName("id")]
public string Id { get; init; }

Property Value

string

OwnerWorkerId

The worker it exists for, or null.

[JsonPropertyName("owner_worker_id")]
public string? OwnerWorkerId { get; init; }

Property Value

string

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

string

Tags

Its tags.

[JsonPropertyName("tags")]
public SortedDictionary<string, string> Tags { get; init; }

Property Value

SortedDictionary<string, string>

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)

Parameters

id string
createdMs long

Returns

TriggerMetadata