예제 #1
0
        public IJob Reserve()
        {
            var multi = new MultiQueue(Client, RedisQueues);
            var item  = multi.Pop();

            if (item != null)
            {
                var queueName = GetQueueName(item.Item1);
                return(JobCreator.CreateJob(FailureService, this, item.Item2, queueName));
            }
            return(null);
        }
 public void should_be_able_to_get_an_enqueued_item()
 {
     var testQueue = "testQueue";
     var item = new QueuedItem()
     {
         @class = Guid.NewGuid().ToString()
     };
     using (var conn = new RedisConnection("localhost"))
     {
         conn.Open();
         var package = new TestPackage(conn);
         package.UnderTest.Push(testQueue, item.@class, item.args);
     
         var multi = new MultiQueue(package.Redis, new[] {testQueue});
         var popped = multi.Pop();
         Assert.AreEqual(item.ToJson(), popped.Item2.ToJson());
     }
 }
예제 #3
0
 public IJob Reserve()
 {
     var multi = new MultiQueue(Client, RedisQueues);
     var item = multi.Pop();
     if (item != null)
     {
         var queueName = GetQueueName(item.Item1);
         return JobCreator.CreateJob(FailureService, this, item.Item2, queueName);
     }
     return null;
 }