private async Task<QueuedEvents> acknowledgeAndProgress(int expectedMaxCount, TimeSpan allocationTimeout, TimeSpan timeout) { var request = new AcknowledgeQueueAndFetchNextRequest(_context, _queueId, _subscriberId, _allocationId, expectedMaxCount, (int)allocationTimeout.TotalMilliseconds); var events = await _acceptor.AcknowledgeAndFetchNext(request, timeout); _allocationId = events.AllocationId; return new QueuedEvents(events.QueueId, events.SubscriberId, events.Events, events.AllocationId, events.TimeOfResponse, this); }
public Task<QueuedEventsResponse> AcknowledgeAndFetchNext(AcknowledgeQueueAndFetchNextRequest request, TimeSpan timeout) { return _buffer.Enqueue<QueuedEventsResponse>(request, DateTime.Now.Add(timeout)); }