Exemple #1
0
 static async Task GetNextChunk(IQueryTimeouts inMemoryTimeoutPersister)
 {
     for (var i = 0; i < 10; i++)
     {
         (await inMemoryTimeoutPersister.GetNextChunk(DateTime.MinValue)).DueTimeouts.ToList();
     }
 }
        public ExpiredTimeoutsPoller(IQueryTimeouts timeoutsFetcher, IDispatchMessages dispatcher, string dispatcherAddress, ICircuitBreaker circuitBreaker, Func<DateTime> currentTimeProvider)
        {
            this.timeoutsFetcher = timeoutsFetcher;
            this.dispatcher = dispatcher;
            this.dispatcherAddress = dispatcherAddress;
            this.circuitBreaker = circuitBreaker;
            this.currentTimeProvider = currentTimeProvider;

            var now = currentTimeProvider();
            startSlice = now.AddYears(-10);
            NextRetrieval = now;
        }
        public ExpiredTimeoutsPoller(IQueryTimeouts timeoutsFetcher, IDispatchMessages dispatcher, string dispatcherAddress, ICircuitBreaker circuitBreaker, Func <DateTime> currentTimeProvider)
        {
            this.timeoutsFetcher     = timeoutsFetcher;
            this.dispatcher          = dispatcher;
            this.dispatcherAddress   = dispatcherAddress;
            this.circuitBreaker      = circuitBreaker;
            this.currentTimeProvider = currentTimeProvider;

            var now = currentTimeProvider();

            startSlice    = now.AddYears(-10);
            NextRetrieval = now;
        }