@Override protected void removeTasksInQueue(final String queueName) { queues.clear(queueName); } }
@Override public Executor getExecutor(final String queueName) { return queues.getExecutor(queueName == null ? DEFAULT_QUEUE : queueName); }
/** * Creates a new Goro instance which uses the specified executor to delegate tasks. * @param delegateExecutor executor Goro delegates tasks to * @return instance of Goro */ public static Goro createWithDelegate(final Executor delegateExecutor) { GoroImpl goro = new GoroImpl(); goro.queues.setDelegateExecutor(delegateExecutor); return goro; }
/** * Creates a new Goro instance which uses the specified executor to delegate tasks. * @param delegateExecutor executor Goro delegates tasks to * @return instance of Goro */ public static Goro createWithDelegate(final Executor delegateExecutor) { GoroImpl goro = new GoroImpl(); goro.queues.setDelegateExecutor(delegateExecutor); return goro; }
@Override public Executor getExecutor(final String queueName) { return queues.getExecutor(queueName == null ? DEFAULT_QUEUE : queueName); }
@Override protected void removeTasksInQueue(final String queueName) { queues.clear(queueName); } }
@Override public <T> ObservableFuture<T> schedule(final String queueName, final Callable<T> task) { if (task == null) { throw new IllegalArgumentException("Task must not be null"); } GoroFuture<T> future = new GoroFuture<>(this, task); listenersHandler.postSchedule(task, queueName); queues.getExecutor(queueName).execute(future); return future; }
@Override public <T> ObservableFuture<T> schedule(final String queueName, final Callable<T> task) { if (task == null) { throw new IllegalArgumentException("Task must not be null"); } GoroFuture<T> future = new GoroFuture<>(this, task); listenersHandler.postSchedule(task, queueName); queues.getExecutor(queueName).execute(future); return future; }