Examples of QSWorker


Examples of com.blacklocus.qs.worker.QSWorker

    }

    @Override
    public Object process(TaskHandle taskHandle) throws Exception {
        QSTaskModel task = taskHandle.task;
        QSWorker worker = workers.get(task.handler);
        if (worker == null) {
            throw new RuntimeException("No worker available for handler identifier: " + task.handler);
        }

        return worker.undertake(new MapConfiguration(task.params), new QSTaskLoggerDelegate(task));
    }
View Full Code Here

Examples of com.blacklocus.qs.worker.api.QSWorker

    @SuppressWarnings("unchecked")
    @Override
    public void withFuture(QSTaskModel task, final Future<Pair<QSTaskModel, Object>> future) {
        // I don't know if this is useful or not.

        QSWorker worker = workers.get(task.handler);
        if (worker == null) {
            throw new RuntimeException("No worker available for worker identifier: " + task.handler);
        }

        final TaskKitFactory factory = new TaskKitFactory(task, worker, logService, workerIdService);
        worker.withFuture(factory, new Future<Pair<TaskKitFactory, Object>>() {
            @Override
            public boolean cancel(boolean mayInterruptIfRunning) {
                return future.cancel(mayInterruptIfRunning);
            }
View Full Code Here

Examples of com.blacklocus.qs.worker.api.QSWorker

        task.started = System.currentTimeMillis();
        task.workerId = workerIdService.getWorkerId();
        LOG.info("Task started: {}", task);
        logService.startedTask(task);

        QSWorker handler = workers.get(task.handler);
        if (handler == null) {
            throw new RuntimeException("No worker available for handler identifier: " + task.handler);
        }

        // The worker only needs to specify how it wants to deserialize its params.
        return handler.convert(new TaskKitFactory(task, handler, logService, workerIdService));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.