feat: add idle heartbeat with pending count headers and flow control stall detection (Gap 3.5)
Heartbeat frames now include Nats-Pending-Messages and Nats-Pending-Bytes headers populated from the ConsumerHandle. Flow control frames increment FlowControlPendingCount; AcknowledgeFlowControl() decrements it. IsFlowControlStalled returns true when pending count reaches MaxFlowControlPending (2). Go reference: consumer.go:5222 (sendIdleHeartbeat), consumer.go:5495 (sendFlowControl).
This commit is contained in:
@@ -320,4 +320,11 @@ public sealed record ConsumerHandle(string Stream, ConsumerConfig Config)
|
||||
public Queue<PushFrame> PushFrames { get; } = new();
|
||||
public AckProcessor AckProcessor { get; } = new();
|
||||
public DateTime NextPushDataAvailableAtUtc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Total pending bytes across all unacknowledged messages.
|
||||
/// Included in idle heartbeat headers as Nats-Pending-Bytes.
|
||||
/// Go reference: consumer.go sendIdleHeartbeat.
|
||||
/// </summary>
|
||||
public long PendingBytes { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user