The ASP.NET Core host swaps the default SignalR hub lifetime manager with OrleansHubLifetimeManager<THub> so all hub operations route through Orleans grains.
In scope
- Hub lifetime manager registration via DI (
AddOrleans). - Connection lifecycle and message routing through Orleans grains.
Out of scope
- Partitioning strategy details (see Connection/Group partitioning docs).
- Observer health and circuit breaker behavior.
- Restore fire-and-forget fan-out for multi-group and multi-user sends.
- Ensure per-target send failures are logged without blocking hub execution.
- Route package-specific batch group membership calls through the Orleans lifetime manager.
- Keep batch group helper calls usable when the host is running plain
AddSignalR(). - Add regression coverage for the batch helper path without Orleans registration.
- Re-run batch partition cleanup after disconnect when a late coordinator write finishes.
flowchart TD
Host["ASP.NET Core host"]
Hub["SignalR hub"]
Batch["Batch group helper"]
Manager["OrleansHubLifetimeManager"]
Grains["SignalR grains"]
Host --> Hub --> Batch --> Manager --> Grains
AddOrleans()registersOrleansHubLifetimeManager<THub>as theHubLifetimeManagerimplementation.- The lifetime manager creates a per-connection
Subscriptionand registers observers with connection/group/user grains. - Package-specific batch group operations (
AddToGroupsAsync/RemoveFromGroupsAsync) also route through the lifetime manager instead of looping over sequential single-group writes. - Hub batch helpers fall back to the registered
HubLifetimeManager<THub>whenIOrleansGroupManager<THub>is not explicitly registered, so the API still works on plainAddSignalR()hosts. - If a partitioned batch join finishes after the connection has already disconnected, the lifetime manager immediately routes a compensating batch remove through the coordinator before returning.
- Detailed batching behavior and partition persistence rules live in
docs/Features/Group-Partitioning.md.
OrleansSignalROptions(registered by the client extension)HubOptionsandHubOptions<THub>(SignalR host configuration)
ManagedCode.Orleans.SignalR.Client/Extensions/OrleansDependencyInjectionExtensions.csManagedCode.Orleans.SignalR.Client/Extensions/OrleansHubGroupExtensions.csManagedCode.Orleans.SignalR.Core/HubContext/IOrleansGroupManager.csManagedCode.Orleans.SignalR.Core/SignalR/OrleansHubLifetimeManager.csManagedCode.Orleans.SignalR.Core/SignalR/Observers/Subscription.cs