Struct StateRate
How often a state-change subscriber wants to be called. Choose with the named factories — Raw, Hz(double), Every(TimeSpan) — rather than passing raw TimeSpan values, so call sites stay self-documenting.
Raw fires on every state-affecting packet (full fidelity, no throttling — appropriate for telemetry recorders, packet loggers, replay capture). Throttled rates fire at most once per MinInterval per subscriber.
public readonly struct StateRate : IEquatable<StateRate>
- Implements
- Inherited Members
Properties
IsRaw
true when no throttling is applied (equivalent to Raw).
public bool IsRaw { get; }
Property Value
MinInterval
Minimum interval between successive deliveries. Zero = no throttling.
public TimeSpan MinInterval { get; }
Property Value
Raw
Fire on every state-affecting packet — no throttling.
public static StateRate Raw { get; }
Property Value
Methods
Equals(StateRate)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(StateRate other)
Parameters
otherStateRateAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
Every(TimeSpan)
At most one delivery per interval.
public static StateRate Every(TimeSpan interval)
Parameters
intervalTimeSpan
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Hz(double)
At most hz deliveries per second.
public static StateRate Hz(double hz)
Parameters
hzdouble
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(StateRate, StateRate)
Returns true if both rates have the same MinInterval.
public static bool operator ==(StateRate a, StateRate b)
Parameters
Returns
operator !=(StateRate, StateRate)
Returns true if the rates have different MinInterval values.
public static bool operator !=(StateRate a, StateRate b)