public Task<TimeoutsChunk> GetNextChunk(DateTime startSlice)
        {
            ThrowExceptionUntilWaitTimeReached();

            var timeoutsDue = new List<TimeoutsChunk.Timeout>();
            foreach (var key in storage.Keys)
            {
                var value = storage[key];
                if (value.Time <= startSlice)
                {
                    var timeout = new TimeoutsChunk.Timeout(key, value.Time);
                    timeoutsDue.Add(timeout);
                }
            }

            var chunk = new TimeoutsChunk(timeoutsDue.ToArray(), DateTime.UtcNow.AddSeconds(1));

            return Task.FromResult(chunk);
        }
Ejemplo n.º 2
0
        public Task <TimeoutsChunk> GetNextChunk(DateTime startSlice)
        {
            ThrowExceptionUntilWaitTimeReached();

            var timeoutsDue = new List <TimeoutsChunk.Timeout>();

            foreach (var key in storage.Keys)
            {
                var value = storage[key];
                if (value.Time <= startSlice)
                {
                    var timeout = new TimeoutsChunk.Timeout(key, value.Time);
                    timeoutsDue.Add(timeout);
                }
            }

            var chunk = new TimeoutsChunk(timeoutsDue.ToArray(), DateTime.UtcNow.AddSeconds(1));

            return(Task.FromResult(chunk));
        }