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); } }
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(); }
public void Push(QueuedItem item) { Client.RPush(RedisName, item.ToJson()); }