IronPigeon.Relay.Controllers.InboxController.AlertLongPollWaiterAsync C# (CSharp) Method

AlertLongPollWaiterAsync() private method

private AlertLongPollWaiterAsync ( InboxEntity inbox ) : Task
inbox IronPigeon.Relay.Models.InboxEntity
return Task
        private async Task AlertLongPollWaiterAsync(InboxEntity inbox)
        {
            Requires.NotNull(inbox, "inbox");

            await this.PushNotifyInboxMessageAsync(inbox);

            var id = inbox.RowKey;
            TaskCompletionSource<object> tcs;
            lock (LongPollWaiters)
            {
                if (LongPollWaiters.TryGetValue(id, out tcs))
                {
                    LongPollWaiters.Remove(id);
                }
            }

            if (tcs != null)
            {
                tcs.TrySetResult(null);
            }
        }