Class InstanceHeartbeatOptions
- Namespace
- Virtufin.WebSocketManager.Configuration
- Assembly
- Virtufin.WebSocketManager.dll
Tuning for the instance heartbeat / discovery mechanism. The
InstanceHeartbeatService publishes the local instance ID to
the Dapr state store on an interval, and the connection reclaimer
reads it to populate its knownInstances set so live pods
don't have their connections reclaimed.
public sealed record InstanceHeartbeatOptions : IEquatable<InstanceHeartbeatOptions>
- Inheritance
-
InstanceHeartbeatOptions
- Implements
- Inherited Members
Fields
DefaultDiscoveryIntervalSeconds
Default discovery interval: 30 seconds.
public const int DefaultDiscoveryIntervalSeconds = 30
Field Value
DefaultHeartbeatIntervalSeconds
Default heartbeat interval: 10 seconds.
public const int DefaultHeartbeatIntervalSeconds = 10
Field Value
DefaultStaleThresholdSeconds
Default stale threshold: 60 seconds (an instance whose heartbeat is older than this is considered dead).
public const int DefaultStaleThresholdSeconds = 60
Field Value
DiscoveryIntervalSecondsEnvVar
Env var for DiscoveryIntervalSeconds.
public const string DiscoveryIntervalSecondsEnvVar = "INSTANCE_DISCOVERY_INTERVAL_SECONDS"
Field Value
HeartbeatDisabled
Heartbeat disabled (heartbeat publishing skipped; reclaimer falls back to TTL-based detection).
public const int HeartbeatDisabled = 0
Field Value
HeartbeatIntervalSecondsEnvVar
Env var for HeartbeatIntervalSeconds.
public const string HeartbeatIntervalSecondsEnvVar = "INSTANCE_HEARTBEAT_INTERVAL_SECONDS"
Field Value
StaleThresholdSecondsEnvVar
Env var for StaleThresholdSeconds.
public const string StaleThresholdSecondsEnvVar = "INSTANCE_STALE_THRESHOLD_SECONDS"
Field Value
Properties
DiscoveryIntervalSeconds
Discovery interval (seconds) — how often this instance polls the state store for other live instances.
public int DiscoveryIntervalSeconds { get; init; }
Property Value
HeartbeatIntervalSeconds
Heartbeat interval (seconds). Set to 0 to disable.
public int HeartbeatIntervalSeconds { get; init; }
Property Value
StaleThresholdSeconds
How old a peer instance's heartbeat can be before it is considered dead.
public int StaleThresholdSeconds { get; init; }
Property Value
Methods
FromEnvironment(Func<string, string?>)
public static InstanceHeartbeatOptions FromEnvironment(Func<string, string?> getEnvironment)