コード例 #1
0
        public void CanPutItemsOnAQueue()
        {
            Dictionary <string, string> person = new Dictionary <string, string>();

            person.Add("name", "chris");
            Assert.That(Resque.Push("people", person), Is.True);
        }
コード例 #2
0
 public static bool create(string queue, string className, params object[] args)
 {
     if (String.IsNullOrEmpty(className))
     {
         throw new NoClassError();
     }
     Resque.Push(queue, new Dictionary <String, Object>()
     {
         { "class", className }, { "args", args }
     });
     return(true);
 }
コード例 #3
0
 public void KnowsWhatQuestsItIsManaging()
 {
     Assert.That(Resque.queues(), Is.EqualTo(new string[1] {
         "people"
     }));
     Resque.Push("cars", new Dictionary <string, string>()
     {
         { "make", "bmw" }
     });
     Assert.That(Resque.queues(), Is.EqualTo(new string[2] {
         "cars", "people"
     }));
 }
コード例 #4
0
 public void CanDeleteAQueue()
 {
     Resque.Push("cars", new Dictionary <string, string>()
     {
         { "make", "bmw" }
     });
     Assert.That(Resque.queues(), Is.EqualTo(new string[2] {
         "cars", "people"
     }));
     Resque.RemoveQueue("people");
     Assert.That(Resque.queues(), Is.EqualTo(new string[1] {
         "cars"
     }));
 }
コード例 #5
0
        public void Init()
        {
            String server = "ec2-184-73-7-218.compute-1.amazonaws.com";

            //String server = "192.168.56.102";
            new Redis(server, 6379).FlushAll(); // This is the IP address of my computer running Redis.
            Resque.setRedis(new Redis(server, 6379));
            Resque.Push("people", new Dictionary <string, string>()
            {
                { "name", "chris" }
            });
            Resque.Push("people", new Dictionary <string, string>()
            {
                { "name", "bob" }
            });
            Resque.Push("people", new Dictionary <string, string>()
            {
                { "name", "mark" }
            });
        }