feat: add per-account subscription result cache with LRU (Gap 5.4)
Implements RouteResultCache with fixed-capacity LRU eviction and atomic generation-based invalidation (Go ref: client.go routeCache, maxResultCacheSize=8192). Fixes AccountGoParityTests namespace ambiguity introduced by new test file.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
using NATS.Server.Auth;
|
||||
using NATS.Server.Imports;
|
||||
using NATS.Server.Subscriptions;
|
||||
|
||||
namespace NATS.Server.Tests.Auth;
|
||||
|
||||
@@ -27,7 +28,7 @@ public class AccountGoParityTests
|
||||
using var accB = new Account("B");
|
||||
|
||||
// Add subscriptions to account A's SubList
|
||||
var subA = new Subscriptions.Subscription { Subject = "foo", Sid = "1" };
|
||||
var subA = new Subscription { Subject = "foo", Sid = "1" };
|
||||
accA.SubList.Insert(subA);
|
||||
|
||||
// Account B should not see account A's subscriptions
|
||||
@@ -51,8 +52,8 @@ public class AccountGoParityTests
|
||||
// Go: TestAccountWildcardRouteMapping — wildcards work per-account.
|
||||
using var acc = new Account("TEST");
|
||||
|
||||
var sub1 = new Subscriptions.Subscription { Subject = "orders.*", Sid = "1" };
|
||||
var sub2 = new Subscriptions.Subscription { Subject = "orders.>", Sid = "2" };
|
||||
var sub1 = new Subscription { Subject = "orders.*", Sid = "1" };
|
||||
var sub2 = new Subscription { Subject = "orders.>", Sid = "2" };
|
||||
acc.SubList.Insert(sub1);
|
||||
acc.SubList.Insert(sub2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user