Package net.greghaines.jesque.worker

Examples of net.greghaines.jesque.worker.WorkerImpl


    @Test
    public void testInterrupted() throws InterruptedException, JsonProcessingException {
        final String queue = "bar";
        TestUtils.enqueueJobs(queue, Arrays.asList(sleepJob), config);

        final Worker worker = new WorkerImpl(config, Arrays.asList(queue),
                new MapBasedJobFactory(JesqueUtils.map(JesqueUtils.entry("SleepAction", SleepAction.class))));
        final Thread workerThread = new Thread(worker);
        workerThread.start();

        TestUtils.stopWorker(worker, workerThread, true);
View Full Code Here


        // Submit a job containing incorrect JSON.
        String incorrectJson = "{";
        jedis.sadd(JesqueUtils.createKey(config.getNamespace(), QUEUES), queue);
        jedis.rpush(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue), incorrectJson);

        final Worker worker = new WorkerImpl(config, Arrays.asList(queue),
                new MapBasedJobFactory(JesqueUtils.map(JesqueUtils.entry("SleepAction", SleepAction.class))));
        final Thread workerThread = new Thread(worker);
        workerThread.start();

        Thread.sleep(1000);
View Full Code Here

   * Create a new <code>SpringWorker</code> using the arguments provided in the factory constructor.
   */
  @Override
  public WorkerImpl call() {
    logger.info("Create new Spring Worker");
    WorkerImpl springWorker = new SpringWorker(this.config, this.queues);
    ((SpringWorker) springWorker).setApplicationContext(this.applicationContext);
    return springWorker;
  }
View Full Code Here

TOP

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

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.