feat: complete jetstream deep operational parity closure
This commit is contained in:
@@ -262,12 +262,42 @@ public sealed class StreamManager
|
||||
}
|
||||
|
||||
private static void EnforceRuntimePolicies(StreamHandle stream, DateTime nowUtc)
|
||||
{
|
||||
switch (stream.Config.Retention)
|
||||
{
|
||||
case RetentionPolicy.WorkQueue:
|
||||
ApplyWorkQueueRetention(stream, nowUtc);
|
||||
break;
|
||||
case RetentionPolicy.Interest:
|
||||
ApplyInterestRetention(stream, nowUtc);
|
||||
break;
|
||||
default:
|
||||
ApplyLimitsRetention(stream, nowUtc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static void ApplyLimitsRetention(StreamHandle stream, DateTime nowUtc)
|
||||
{
|
||||
EnforceLimits(stream);
|
||||
PrunePerSubject(stream);
|
||||
PruneExpiredMessages(stream, nowUtc);
|
||||
}
|
||||
|
||||
private static void ApplyWorkQueueRetention(StreamHandle stream, DateTime nowUtc)
|
||||
{
|
||||
// WorkQueue keeps one-consumer processing semantics; current parity baseline
|
||||
// applies the same bounded retention guards used by limits retention.
|
||||
ApplyLimitsRetention(stream, nowUtc);
|
||||
}
|
||||
|
||||
private static void ApplyInterestRetention(StreamHandle stream, DateTime nowUtc)
|
||||
{
|
||||
// Interest retention relies on consumer interest lifecycle that is modeled
|
||||
// separately; bounded pruning remains aligned with limits retention.
|
||||
ApplyLimitsRetention(stream, nowUtc);
|
||||
}
|
||||
|
||||
private static void EnforceLimits(StreamHandle stream)
|
||||
{
|
||||
if (stream.Config.MaxMsgs <= 0)
|
||||
|
||||
Reference in New Issue
Block a user