Exemple #1
0
        static void Main(string[] args)
        {
            Console.WriteLine(resque.DummyJob.assemblyQualifiedName());

            Type t = typeof (DummyJob);
            Assembly.GetExecutingAssembly();

            Console.WriteLine(t.AssemblyQualifiedName);
            string assemblyQualification = ", ExampleRunner, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
            Resque.setAssemblyQualifier(assemblyQualification);
            String server = "172.19.104.133";
            Resque.setRedis(new RedisConnection(server, 6379));

            var w = new Worker("jobs");
            var thread = new Thread(() =>
                                   {

                                       w.work(1);
                                   });
            thread.Start();
            Job.create("jobs", "LongJob");
            Job.create("jobs", "DummyJob", "foo", 20, "bar");

            Job.create("jobs", "ErrorJob");

            System.Console.ReadLine();
            w.Dispose();
            thread.Abort();
        }
Exemple #2
0
 public Redis(Exception exception, Worker worker, String queue, Object payload)
 {
     this.exception = exception;
     this.worker = worker;
     this.queue = queue;
     this.payload = payload;
 }
Exemple #3
0
 public static Worker find(string id)
 {
     if (isExisting(id))
     {
         string[] components = id.Split(":".ToCharArray());
         string queuesPacked = components[components.Length - 1];
         string[] queues = queuesPacked.Split(",".ToCharArray());
         Worker worker = new Worker(queues);
         worker.id = id;
         return worker;
     }
     else
     {
         return null;
     }
 }
Exemple #4
0
        static void Main(string[] args)
        {
            Console.WriteLine(resque.DummyJob.assemblyQualifiedName());

            Type t = typeof(DummyJob);
            Assembly.GetExecutingAssembly();

            Console.WriteLine(t.AssemblyQualifiedName);
            string assemblyQualification = ", ExampleRunner, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null";
            Resque.setAssemblyQualifier(assemblyQualification);
            String server = "192.168.1.7";
            Resque.setRedis(new Redis(server, 6379));
            Job.create("jobs", "DummyJob", "foo", 20, "bar");
            Worker w = new Worker("*");
            w.work(1);
        }
        public void CanWorkOnAllQueues()
        {
            Job.create("high", "resque.GoodJob");
            Job.create("critical", "resque.GoodJob");
            Job.create("blahblah", "resque.GoodJob");

            worker = new Worker("*");

            worker.work(0);

            Console.WriteLine(Resque.size("high"));
            Console.WriteLine(Resque.size("critical"));
            Console.WriteLine(Resque.size("blahblah"));

            Assert.AreEqual(Resque.size("high"), 0);
            Assert.AreEqual(Resque.size("critical"), 0);
            Assert.AreEqual(Resque.size("blahblah"), 0);
        }
        public void CanWorkOnMultipleQueues()
        {
            Job.create("high", "resque.GoodJob");
            Job.create("critical", "resque.GoodJob");

            worker = new Worker(new string[] {"critical", "high" });

            worker.process();
            Assert.AreEqual(Resque.size("high"), 1);
            Assert.AreEqual(Resque.size("critical"), 0);

            worker.process();
            Assert.AreEqual(Resque.size("high"), 0);
        }
        public void ProcesesAllQueuesInAlphabeticalOrder()
        {
            Job.create("high", "resque.GoodJob");
            Job.create("critical", "resque.GoodJob");
            Job.create("blahblah", "resque.GoodJob");

            worker = new Worker("*");

            //worker.work(0, (List<String> queueList) => { int a; });
        }
        public void Init()
        {
            //server = "ec2-184-73-7-218.compute-1.amazonaws.com";
            server = "172.19.104.133";

            Resque.setRedis(new RedisConnection(server, 6379,allowAdmin:true));
            Resque.redis().Server.FlushAll();
            worker = new Worker("jobs");
            //Job.create("jobs", "resque.DummyJob", 20, "/tmp");
        }
        public void Init()
        {
            // This is the IP address of my computer running Redis.
            //server = "ec2-184-73-7-218.compute-1.amazonaws.com";
            server = "172.19.104.133";

            Resque.setRedis(new RedisConnection(server, 6379,allowAdmin:true));
            Resque.redis().Server.FlushAll();

            Exception ex = new Exception(testString);
            Worker worker = new Worker();
            String queue = testString;
            payload = Encoding.UTF8.GetBytes(testString);

            myRedis = new Failure.Redis(ex, worker, queue, payload);
        }
Exemple #10
0
        public void Init()
        {
            server = "ec2-184-73-7-218.compute-1.amazonaws.com";
            //string server = "192.168.56.102";

            Resque.setRedis(new Redis(server, 6379));
            Resque.redis().FlushAll();
            worker = new Worker("jobs");
            //Job.create("jobs", "resque.DummyJob", 20, "/tmp");
        }
        public void Init()
        {
            // This is the IP address of my computer running Redis.
            server = "ec2-184-73-7-218.compute-1.amazonaws.com";
            //server = "192.168.56.102";

            Resque.setRedis(new Redis(server, 6379));
            Resque.redis().FlushAll();

            Exception ex = new Exception(testString);
            Worker worker = new Worker();
            String queue = testString;
            payload = Encoding.UTF8.GetBytes(testString);

            myRedis = new Failure.Redis(ex, worker, queue, payload);
        }