PDComm.HsmsWorkerOptions
Class
Queue capacities and timing for HsmsWorker, GemEquipmentWorker and GemHostWorker.
public sealed record HsmsWorkerOptionsThe worker validates these values when it starts and throws ArgumentOutOfRangeException if a capacity, interval or timeout is not positive, a byte budget is negative, or HsmsWorkerOptions.MaxEventBytes cannot hold one frame body (HsmsOptions.MaxFrameBytes minus 14). GEM workers additionally require room for one GEM result per event.
Members
HsmsWorkerOptions
Constructor
Initializes a new instance with default values.
public HsmsWorkerOptions()Notes
- Set every
requiredproperty of the type in an object initializer.
CommandCapacity
Property
Gets the largest number of commands waiting to run on the worker thread; also the most commands run per loop.
public required int CommandCapacity { get; init; }EventCapacity
Property
Gets the largest number of events buffered for ReadEventsAsync; also the most native events read per loop.
public required int EventCapacity { get; init; }MaxCommandBytes
Property
Gets the largest total size, in bytes, of the inputs (message bodies and captured values) of waiting commands.
public required long MaxCommandBytes { get; init; }A command that is larger than the whole budget is rejected with PdcommException and PdcommStatus.Backpressure, so retrying it cannot succeed. GEM worker commands that keep a received GemResult alive until they run, such as GemHostWorker.AcknowledgeEventAsync, GemHostWorker.AcknowledgeAlarmAsync and the respond commands, reserve one message (SecsLimits.MessageBytes of the endpoint's item limits) each. Choose a budget of at least that size when the worker must answer received primaries.
MaxEventBytes
Property
Gets the largest total size, in bytes, of the events buffered for ReadEventsAsync.
public required long MaxEventBytes { get; init; }PollIntervalMilliseconds
Property
Gets the longest time, in milliseconds, the worker sleeps between polls; it wakes earlier when work arrives.
public required int PollIntervalMilliseconds { get; init; }ShutdownTimeoutMilliseconds
Property
Gets how long, in milliseconds, the worker may take to close the connection and drain after a stop or disposal before it fails with TimeoutException.
public required int ShutdownTimeoutMilliseconds { get; init; }