public async ValueTask SetTemporaryPermission(Participant participant, string key, JValue value) { var redisKey = GetKey(participant.ConferenceId); var lockKey = GetLockKey(participant); await using (await _redisDatabase.AcquireLock(lockKey)) { var currentPermissions = await FetchTemporaryPermissions(participant); var newPermissions = new Dictionary <string, JValue>(currentPermissions) { [key] = value }; await _redisDatabase.HashSetAsync(redisKey, participant.Id, newPermissions); } }
public async ValueTask <IAcquiredLock> LockParticipantJoin(Participant participant) { var key = GetParticipantJoinLockKey(participant); return(await _database.AcquireLock(key)); }
public async ValueTask <IAcquiredLock> LockScene(string conferenceId, string roomId) { var lockKey = GetLockKey(conferenceId, roomId); return(await _database.AcquireLock(lockKey)); }
public async ValueTask <IAsyncDisposable> LockBreakoutRooms(string conferenceId) { var key = GetLockKey(conferenceId); return(await _database.AcquireLock(key)); }