示例#1
0
        public async Task RemoveParticipant(ISessionParticipant participant)
        {
            _participants.Remove(participant.GetPrimaryKey());

            await Task.WhenAll(_participants.Select(
                                   pair => pair.Value.OnParticipantLeave(participant.GetPrimaryKey())
                                   ));
        }
示例#2
0
        public async Task AddParticipant(ISessionParticipant participant)
        {
            await Task.WhenAll(_participants.Select(
                                   pair => pair.Value.OnParticipantJoin(participant.GetPrimaryKey())
                                   ));

            _participants.Add(participant.GetPrimaryKey(), participant);
        }