Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        /// <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);
            }
        }