perf: pool SubList match builders and cleanup scans
This commit is contained in:
@@ -45,4 +45,20 @@ public class SubListAllocationGuardTests
|
||||
matches.Count.ShouldBe(4);
|
||||
matches.ShouldAllBe(match => match.Queue == "workers");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Match_merges_queue_groups_from_multiple_matching_nodes_by_queue_name()
|
||||
{
|
||||
using var sl = new SubList();
|
||||
sl.Insert(new Subscription { Subject = "orders.created", Queue = "workers", Sid = "1" });
|
||||
sl.Insert(new Subscription { Subject = "orders.*", Queue = "workers", Sid = "2" });
|
||||
sl.Insert(new Subscription { Subject = "orders.>", Queue = "audit", Sid = "3" });
|
||||
|
||||
var result = sl.Match("orders.created");
|
||||
|
||||
result.PlainSubs.ShouldBeEmpty();
|
||||
result.QueueSubs.Length.ShouldBe(2);
|
||||
result.QueueSubs.Single(group => group[0].Queue == "workers").Length.ShouldBe(2);
|
||||
result.QueueSubs.Single(group => group[0].Queue == "audit").Length.ShouldBe(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user