Esempio n. 1
0
        public void Should_remove_timeouts_by_id()
        {
            var t1 = new TimeoutData {
                Id = "1", Time = DateTime.UtcNow.AddHours(-1)
            };

            persister.Add(t1);

            var t2 = new TimeoutData {
                Id = "2", Time = DateTime.UtcNow.AddHours(-1)
            };

            persister.Add(t2);

            var timeouts = GetNextChunk();

            foreach (var timeout in timeouts)
            {
                TimeoutData timeoutData;
                persister.TryRemove(timeout.Item1, out timeoutData);
            }

            Assert.AreEqual(0, GetNextChunk().Count);
        }
Esempio n. 2
0
 static async Task TryRemove(IPersistTimeouts inMemoryTimeoutPersister, ContextBag context)
 {
     await inMemoryTimeoutPersister.TryRemove(Thread.CurrentThread.Name, context);
 }
 public bool TryRemove(string timeoutId, out TimeoutData timeoutData)
 {
     return(originalTimeoutPersister.TryRemove(timeoutId, out timeoutData));
 }