Package net.greghaines.jesque.worker

Examples of net.greghaines.jesque.worker.Worker


            for (int j = 0; j < 5; j++) {
                jobs.add(new Job("FailAction"));
            }
            TestUtils.enqueueJobs("bar", jobs, config);
        }
        final Worker worker = new WorkerImpl(config, Arrays.asList("foo0", "bar", "baz"),
                new MapBasedJobFactory(map(entry("TestAction", TestAction.class),
                        entry("FailAction", FailAction.class))));
        final Thread workerThread = new Thread(worker);
        workerThread.start();

        TestUtils.enqueueJobs("inf", Arrays.asList(new Job("InfiniteAction")), config);
        final Worker worker2 = new WorkerImpl(config, Arrays.asList("inf"),
                new MapBasedJobFactory(map(entry("InfiniteAction", InfiniteAction.class))));
        final Thread workerThread2 = new Thread(worker2);
        workerThread2.start();
        worker2.togglePause(true);

        workerThread.join();
    }
View Full Code Here


    }

    @Test
    @Ignore
    public void issue6() throws InterruptedException {
        final Worker worker = new WorkerImpl(config, Arrays.asList("foo"),
                new MapBasedJobFactory(map(entry("TestAction", TestAction.class),
                        entry("FailAction", FailAction.class))));
        final Thread workerThread = new Thread(worker);
        workerThread.start();
View Full Code Here

        } finally {
            jedis.quit();
        }

        // Create and start worker
        final Worker worker = new WorkerImpl(config, Arrays.asList(delayTestQueue),
                new MapBasedJobFactory(map(entry("TestAction", TestAction.class))));
        final Thread workerThread = new Thread(worker);
        workerThread.start();

        // start second thread
        final Worker worker2 = new WorkerImpl(config, Arrays.asList(testQueue),
                new MapBasedJobFactory(map(entry("TestAction", TestAction.class))));
        final Thread workerThread2 = new Thread(worker2);
        workerThread2.start();

        try { // Wait a bit to ensure the worker had time to process the job
View Full Code Here

TOP

Related Classes of net.greghaines.jesque.worker.Worker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.