public void CanPullItemsOffAQueue()
 {
     Assert.That("chris", Is.EqualTo(((Dictionary <string, object>)Resque.Pop("people"))["name"]));
     Assert.That("bob", Is.EqualTo(((Dictionary <string, object>)Resque.Pop("people"))["name"]));
     Assert.That("mark", Is.EqualTo(((Dictionary <string, object>)Resque.Pop("people"))["name"]));
     Assert.That(Resque.Pop("people"), Is.Null);
 }
 public void KnowsHowBigAQueueIs()
 {
     Assert.That(Resque.size("people"), Is.EqualTo(3));
     Assert.That("chris", Is.EqualTo(((Dictionary <string, object>)Resque.Pop("people"))["name"]));
     Assert.That(Resque.size("people"), Is.EqualTo(2));
     Resque.Pop("people");
     Resque.Pop("people");
     Assert.That(Resque.size("people"), Is.EqualTo(0));
 }
Beispiel #3
0
        internal static Job Reserve(string queue)
        {
            Dictionary <string, object> payload = Resque.Pop(queue);

            if (payload == null)
            {
                return(null);
            }
            return(new Job(queue, payload));
        }