Table of Contents

Class WorkerConfig

Namespace
Virtufin.WorkManager.Contracts
Assembly
Virtufin.WorkManager.dll

Configuration for a worker instance.

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

Constructors

WorkerConfig(Guid, CodeSource, string, List<string>, DateTime, List<HistoryEntry>, Dictionary<string, string>?, Dictionary<string, string>?, string?, WorkerStatus?, bool)

Configuration for a worker instance.

public WorkerConfig(Guid Id, CodeSource CodeSource, string MimeType, List<string> Topics, DateTime CreatedAt, List<HistoryEntry> History, Dictionary<string, string>? Config = null, Dictionary<string, string>? Tags = null, string? InstanceId = null, WorkerStatus? Status = null, bool StartRequested = false)

Parameters

Id Guid

The unique identifier.

CodeSource CodeSource

The source of the worker's code.

MimeType string

The MIME type of the code.

Topics List<string>

The topics to subscribe to (one or more).

CreatedAt DateTime

The creation timestamp.

History List<HistoryEntry>

The history of code changes.

Config Dictionary<string, string>

Worker-instance defaults, immutable after creation. Delivered to the worker on every incoming trigger CloudEvent as extension attributes (not process environment variables), so values never leak between workers co-loaded in the same WorkManager process.

Tags Dictionary<string, string>
InstanceId string
Status WorkerStatus?

Persisted lifecycle status, or null for any config written before this field existed (treated as Running -- every worker that ever got this far was running, and nothing before this field could ever persist "stopped"). Needed so a persisted-only stop (WorkManagerGrpcService's reclaim fallback, for a worker whose owning instance no longer exists) is actually observable, and so a later recovery of the same config doesn't silently un-stop it.

StartRequested bool

Properties

CodeSource

The source of the worker's code.

public CodeSource CodeSource { get; init; }

Property Value

CodeSource

Config

Worker-instance defaults, immutable after creation. Delivered to the worker on every incoming trigger CloudEvent as extension attributes (not process environment variables), so values never leak between workers co-loaded in the same WorkManager process.

public Dictionary<string, string>? Config { get; init; }

Property Value

Dictionary<string, string>

CreatedAt

The creation timestamp.

public DateTime CreatedAt { get; init; }

Property Value

DateTime

History

The history of code changes.

public List<HistoryEntry> History { get; init; }

Property Value

List<HistoryEntry>

Id

The unique identifier.

public Guid Id { get; init; }

Property Value

Guid

InstanceId

public string? InstanceId { get; init; }

Property Value

string

MimeType

The MIME type of the code.

public string MimeType { get; init; }

Property Value

string

StartRequested

public bool StartRequested { get; init; }

Property Value

bool

Status

Persisted lifecycle status, or null for any config written before this field existed (treated as Running -- every worker that ever got this far was running, and nothing before this field could ever persist "stopped"). Needed so a persisted-only stop (WorkManagerGrpcService's reclaim fallback, for a worker whose owning instance no longer exists) is actually observable, and so a later recovery of the same config doesn't silently un-stop it.

public WorkerStatus? Status { get; init; }

Property Value

WorkerStatus?

Tags

public Dictionary<string, string>? Tags { get; init; }

Property Value

Dictionary<string, string>

Topics

The topics to subscribe to (one or more).

public List<string> Topics { get; init; }

Property Value

List<string>