Extract INatsClient interface from NatsClient to enable internal clients (SYSTEM, ACCOUNT) to participate in the subscription system without requiring a socket connection. Change Subscription.Client from concrete NatsClient to INatsClient, keeping IMessageRouter and RemoveClient using the concrete type since only socket clients need those paths.
14 lines
370 B
C#
14 lines
370 B
C#
using NATS.Server;
|
|
|
|
namespace NATS.Server.Subscriptions;
|
|
|
|
public sealed class Subscription
|
|
{
|
|
public required string Subject { get; init; }
|
|
public string? Queue { get; init; }
|
|
public required string Sid { get; init; }
|
|
public long MessageCount; // Interlocked
|
|
public long MaxMessages; // 0 = unlimited
|
|
public INatsClient? Client { get; set; }
|
|
}
|