Package com.blacklocus.qs.worker.api

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


        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

Related Classes of com.blacklocus.qs.worker.api.QSWorker

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.