public async Task RemoveMessageSubscription(UnsubscribeMessageCommand command) { await Lock.WaitAsync(); try { MessageSubscriptions.Remove(command.ReferenceId); } finally { Lock.Release(); } }
public async Task AddMessageSubscription(SubscribeMessageCommand command) { await Lock.WaitAsync(); try { MessageSubscriptions.Add(command.ReferenceId, command.Topic); } finally { Lock.Release(); } }