31 lines
1.2 KiB
C#
31 lines
1.2 KiB
C#
namespace ZB.MOM.WW.MxGateway.Server.Configuration;
|
|
|
|
public sealed class EventOptions
|
|
{
|
|
/// <summary>
|
|
/// Gets the event queue capacity.
|
|
/// </summary>
|
|
public int QueueCapacity { get; init; } = 10_000;
|
|
|
|
/// <summary>
|
|
/// Gets the backpressure policy for event queue overflow.
|
|
/// </summary>
|
|
public EventBackpressurePolicy BackpressurePolicy { get; init; } = EventBackpressurePolicy.FailFast;
|
|
|
|
/// <summary>
|
|
/// Gets the maximum number of events retained in the per-session replay ring buffer
|
|
/// used to re-deliver events a returning subscriber missed (reconnect/reattach).
|
|
/// When the buffer exceeds this count the oldest retained events are evicted first.
|
|
/// A value of <c>0</c> disables replay retention entirely.
|
|
/// </summary>
|
|
public int ReplayBufferCapacity { get; init; } = 1024;
|
|
|
|
/// <summary>
|
|
/// Gets the maximum age, in seconds, of an event retained in the per-session replay
|
|
/// ring buffer. Entries older than this are evicted regardless of capacity. A value
|
|
/// of <c>0</c> disables age-based eviction (only <see cref="ReplayBufferCapacity"/>
|
|
/// bounds the buffer).
|
|
/// </summary>
|
|
public double ReplayRetentionSeconds { get; init; } = 300;
|
|
}
|