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());
     }
 }
        public void should_add_item_to_queue()
        {
            var testQueue = "testQueue";
            var item = new QueuedItem()
                               {
                                   @class = "Testing"
                               };
            using (var conn = new RedisConnection("localhost"))
            {
                conn.Open();
                var package = new TestPackage(conn);
                package.UnderTest.Push(testQueue, item.@class, item.args);

                var test = conn.Wait(conn.Lists.RemoveLastString(0, package.Redis.KeyInNamespace("queue:" + testQueue)));

                Assert.AreEqual(item.ToJson(), test);
            }
        }
예제 #3
0
 public void Create(QueuedItem payload, Exception exception, IWorker worker, string queue)
 {
     Backend.Create(payload, exception, worker, queue).Save();
 }
 public IJob CreateJob(IFailureService failureService, Worker worker, QueuedItem deserializedObject, string queue)
 {
     throw new NotImplementedException();
 }
예제 #5
0
 public void Push(QueuedItem item)
 {
     Client.RPush(RedisName, item.ToJson());
 }
예제 #6
0
 public void Create(QueuedItem payload, Exception exception, IWorker worker, string queue)
 {
     Backend.Create(payload, exception, worker, queue).Save();
 }
예제 #7
0
 public void Push(QueuedItem item)
 {
     Client.RPush(RedisName, item.ToJson());
 }