/// <summary> /// <inheritdoc/> /// </summary> public void AddToGroupLocal(HubConnectionContext connection, string groupName) { var feature = connection.Features.Get <RebusFeature>(); feature.Groups.TryAdd(groupName, true); var groupStore = GroupConnections.GetOrAdd(groupName, _ => new HubConnectionStore()); groupStore.Add(connection); }
/// <summary> /// <inheritdoc/> /// </summary> public void RemoveFromGroupLocal(HubConnectionContext connection, string groupName) { var feature = connection.Features.Get <RebusFeature>(); feature.Groups.TryRemove(groupName, out _); if (GroupConnections.TryGetValue(groupName, out var groupStore)) { groupStore.Remove(connection); } }