Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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));
 }
Ejemplo n.º 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));
        }