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, [email protected], item.args);

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

                Assert.AreEqual(item.ToJson(), test);
            }
        }
 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, ite[email protected], item.args);
     
         var multi = new MultiQueue(package.Redis, new[] {testQueue});
         var popped = multi.Pop();
         Assert.AreEqual(item.ToJson(), popped.Item2.ToJson());
     }
 }
Example #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();
 }
Example #5
0
 public void Push(QueuedItem item)
 {
     Client.RPush(RedisName, item.ToJson());
 }