feat(batch27): implement jetstream bootstrap and account wiring
This commit is contained in:
@@ -32,7 +32,7 @@ namespace ZB.MOM.NatsNet.Server;
|
||||
/// <see cref="ClientConnection"/> can interact with it without a hard dependency.
|
||||
/// Mirrors Go <c>Account</c> struct in server/accounts.go.
|
||||
/// </summary>
|
||||
public sealed class Account : INatsAccount
|
||||
public sealed partial class Account : INatsAccount
|
||||
{
|
||||
// -------------------------------------------------------------------------
|
||||
// Constants
|
||||
@@ -261,7 +261,7 @@ public sealed class Account : INatsAccount
|
||||
/// JetStream account state. Mirrors Go <c>js *jsAccount</c>.
|
||||
/// TODO: session 19 — JetStream implementation.
|
||||
/// </summary>
|
||||
internal object? JetStream { get; set; }
|
||||
internal JsAccount? JetStream { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Per-domain JetStream limits. Mirrors Go <c>jsLimits map[string]JetStreamAccountLimits</c>.
|
||||
@@ -2279,7 +2279,7 @@ public sealed class Account : INatsAccount
|
||||
}
|
||||
|
||||
if (sid is { Length: > 0 } && InternalClient != null)
|
||||
InternalClient.ProcessUnsub(sid);
|
||||
InternalClient.RemoveSubscriptionBySid(sid);
|
||||
|
||||
if (tracking && requestor != null && !delivered)
|
||||
SendBackendErrorTrackingLatency(serviceImport, reason);
|
||||
@@ -2355,7 +2355,7 @@ public sealed class Account : INatsAccount
|
||||
}
|
||||
|
||||
if (sid != null && InternalClient != null)
|
||||
InternalClient.ProcessUnsub(sid);
|
||||
InternalClient.RemoveSubscriptionBySid(sid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2548,7 +2548,7 @@ public sealed class Account : INatsAccount
|
||||
if (InternalClient == null && Server is NatsServer server)
|
||||
{
|
||||
InternalClient = server.CreateInternalAccountClient();
|
||||
InternalClient.Account = this;
|
||||
InternalClient.SetAccount(this);
|
||||
}
|
||||
|
||||
return InternalClient;
|
||||
@@ -2573,7 +2573,7 @@ public sealed class Account : INatsAccount
|
||||
_mu.EnterReadLock();
|
||||
var internalClient = InternalClient;
|
||||
_mu.ExitReadLock();
|
||||
internalClient?.ProcessUnsub(sub.Sid);
|
||||
internalClient?.RemoveSubscriptionBySid(sub.Sid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2685,7 +2685,7 @@ public sealed class Account : INatsAccount
|
||||
return;
|
||||
|
||||
foreach (var sid in subscriptionIds)
|
||||
internalClient.ProcessUnsub(sid);
|
||||
internalClient.RemoveSubscriptionBySid(sid);
|
||||
|
||||
internalClient.CloseConnection(ClosedState.InternalClient);
|
||||
}
|
||||
@@ -4170,7 +4170,7 @@ public sealed class Account : INatsAccount
|
||||
return new ClientInfo
|
||||
{
|
||||
Id = client.Cid,
|
||||
Account = client.Account?.Name ?? string.Empty,
|
||||
Account = client.Account()?.Name ?? string.Empty,
|
||||
Name = client.Opts.Name ?? string.Empty,
|
||||
Rtt = client.GetRttValue(),
|
||||
Start = client.Start == default ? string.Empty : client.Start.ToUniversalTime().ToString("O"),
|
||||
|
||||
Reference in New Issue
Block a user