You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. The ASP.NET Core hub writes to `OrleansHubLifetimeManager<T>` instead of the default SignalR manager.
99
+
2. The lifetime manager resolves the Orleans grains that own connections, groups, users, and invocations.
100
+
3. Grains fan messages back to clients by invoking the observers recorded for each connection.
99
101
100
-
1.**Connection observed** — when a client connects, the lifetime manager creates a hub subscription (`ISignalRObserver`).
101
-
2.**Coordinator assignment** — `SignalRConnectionCoordinatorGrain` maps the connection to a partition via consistent hashing.
102
-
3.**Partition grain** — `SignalRConnectionPartitionGrain` stores the observer key and relays messages to the client.
103
-
4.**Dynamic scaling** — partition counts expand to powers of two when tracked connections exceed `ConnectionsPerPartitionHint`. When the load drops to zero, the count resets to the configured base.
1.**Connection observed** — the lifetime manager registers an `ISignalRObserver` when a client connects.
118
+
2.**Coordinator assignment** — `SignalRConnectionCoordinatorGrain` hashes the connection ID to a partition number.
119
+
3.**Partition grain** — `SignalRConnectionPartitionGrain` stores the observer handle and relays messages such as `Clients.All`, `Clients.Client`, or `Clients.User`.
120
+
4.**Dynamic scaling** — the coordinator grows the partition ring (powers of two) when `ConnectionsPerPartitionHint` is exceeded and shrinks it when load drops to zero.
119
121
120
-
1.**Group coordinator** — `SignalRGroupCoordinatorGrain` tracks group names and membership counts.
121
-
2.**Group partition assignment** — groups are consistently hashed to `SignalRGroupPartitionGrain` instances using the same power-of-two heuristic (`GroupPartitionCount` + `GroupsPerPartitionHint`).
122
-
3.**Partition state** — each partition stores bidirectional maps of connections-to-groups and group-to-observer links, enabling efficient `SendToGroup`, `SendToGroups`, and exclusions.
123
-
4.**Automatic cleanup** — when a group empties, the coordinator is notified so partitions can release unused entries and (if idle) shrink back to the base partition count.
1.**Group coordinator** — `SignalRGroupCoordinatorGrain` maintains group membership counts.
139
+
2.**Partition assignment** — group names are hashed to `SignalRGroupPartitionGrain` instances using the same power-of-two heuristic (`GroupPartitionCount` plus `GroupsPerPartitionHint`).
140
+
3.**Partition state** — partitions keep connection↔group maps so `SendToGroup`, `SendToGroups`, and exclusion variants can enumerate the relevant observers quickly.
141
+
4.**Automatic cleanup** — when a group becomes empty the coordinator notifies partitions so they can drop state and resize if necessary.
142
+
138
143
### Connection, Group, and User Grains
139
144
140
145
-`SignalRConnectionHolderGrain` and `SignalRGroupGrain` remain as non-partitioned fallbacks when partitioning is disabled (`ConnectionPartitionCount = 1` or `GroupPartitionCount = 1`).
0 commit comments