@Override public int compareTo(final Delayed other) { return DelayedUtil.compareDelayed(this, other); }
@Override public long getDelay(final TimeUnit unit) { return DelayedUtil.getRemainingTime(unit, getTimeout()); }
public static int compareDelayed(final Delayed o1, final Delayed o2) { return Long.compare(getTimeout(o1), getTimeout(o2)); }
@Override public void run() { while (executor.isRunning()) { final DelayedWithTimeout task = DelayedUtil.takeWithoutInterrupt(queue); if (task == null || task == DelayedUtil.DELAYED_POISON) { // the executor may be shutting down, // and the task is just the shutdown request continue; } LOG.trace("Executing {}", task); // execute the task if (task instanceof InlineChore) { execInlineChore((InlineChore) task); } else if (task instanceof DelayedProcedure) { execDelayedProcedure((DelayedProcedure<TEnvironment>) task); } else { LOG.error("CODE-BUG unknown timeout task type {}", task); } } }
@Override public void run() { while (executor.isRunning()) { final DelayedWithTimeout task = DelayedUtil.takeWithoutInterrupt(queue); if (task == null || task == DelayedUtil.DELAYED_POISON) { // the executor may be shutting down, // and the task is just the shutdown request continue; } LOG.trace("Executing {}", task); // execute the task if (task instanceof InlineChore) { execInlineChore((InlineChore) task); } else if (task instanceof DelayedProcedure) { execDelayedProcedure((DelayedProcedure<TEnvironment>) task); } else { LOG.error("CODE-BUG unknown timeout task type {}", task); } } }
@Override public long getDelay(final TimeUnit unit) { return DelayedUtil.getRemainingTime(unit, getTimeout()); }
@Override public int compareTo(final Delayed other) { return DelayedUtil.compareDelayed(this, other); }
public static int compareDelayed(final Delayed o1, final Delayed o2) { return Long.compare(getTimeout(o1), getTimeout(o2)); }
@Override public void run() { while (executor.isRunning()) { final DelayedWithTimeout task = DelayedUtil.takeWithoutInterrupt(queue); if (task == null || task == DelayedUtil.DELAYED_POISON) { // the executor may be shutting down, // and the task is just the shutdown request continue; } LOG.trace("Executing {}", task); // execute the task if (task instanceof InlineChore) { execInlineChore((InlineChore) task); } else if (task instanceof DelayedProcedure) { execDelayedProcedure((DelayedProcedure) task); } else { LOG.error("CODE-BUG unknown timeout task type {}", task); } } }
@Override public long getDelay(final TimeUnit unit) { return DelayedUtil.getRemainingTime(unit, getTimeout()); }
@Override public int compareTo(final Delayed other) { return DelayedUtil.compareDelayed(this, other); }
public static int compareDelayed(final Delayed o1, final Delayed o2) { return Long.compare(getTimeout(o1), getTimeout(o2)); }