@Override protected final <T> RunnableFuture<T> newTaskFor(Callable<T> callable) { return new PromiseTask<T>(this, callable); }
boolean cancelWithoutRemove(boolean mayInterruptIfRunning) { return super.cancel(mayInterruptIfRunning); }
@Override protected EventExecutor executor() { return super.executor(); }
@Override public void run() { try { if (setUncancellableInternal()) { V result = task.call(); setSuccessInternal(result); } } catch (Throwable e) { setFailureInternal(e); } }
@Override protected StringBuilder toStringBuilder() { StringBuilder buf = super.toStringBuilder(); buf.setCharAt(buf.length() - 1, ','); return buf.append(" id: ") .append(id) .append(", deadline: ") .append(deadlineNanos) .append(", period: ") .append(periodNanos) .append(')'); }
PromiseTask(EventExecutor executor, Runnable runnable, V result) { this(executor, toCallable(runnable, result)); }
@Override public void run() { if (!isPeriodic()) { super.run(); } else if (!isDone()) { try { // Its a periodic task so we need to ignore the return value task.call(); } catch (Throwable cause) { if (!tryFailureInternal(cause)) { logger.warn("Failure during execution of task", cause); } } } }
@Override public void run() { try { if (setUncancellableInternal()) { V result = task.call(); setSuccessInternal(result); } } catch (Throwable e) { setFailureInternal(e); } }
@Override protected StringBuilder toStringBuilder() { StringBuilder buf = super.toStringBuilder(); buf.setCharAt(buf.length() - 1, ','); return buf.append(" id: ") .append(id) .append(", deadline: ") .append(deadlineNanos) .append(", period: ") .append(periodNanos) .append(')'); }
PromiseTask(EventExecutor executor, Runnable runnable, V result) { this(executor, toCallable(runnable, result)); }
@Override public void run() { if (!isPeriodic()) { super.run(); } else if (!isDone()) { try { // Its a periodic task so we need to ignore the return value task.call(); } catch (Throwable cause) { if (!tryFailureInternal(cause)) { logger.warn("Failure during execution of task", cause); } } } }
@Override public void run() { try { if (setUncancellableInternal()) { V result = task.call(); setSuccessInternal(result); } } catch (Throwable e) { setFailureInternal(e); } }
boolean cancelWithoutRemove(boolean mayInterruptIfRunning) { return super.cancel(mayInterruptIfRunning); }
@Override protected final <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value) { return new PromiseTask<T>(this, runnable, value); }
@Override protected EventExecutor executor() { return super.executor(); }
@Override protected StringBuilder toStringBuilder() { StringBuilder buf = super.toStringBuilder(); buf.setCharAt(buf.length() - 1, ','); return buf.append(" id: ") .append(id) .append(", deadline: ") .append(deadlineNanos) .append(", period: ") .append(periodNanos) .append(')'); }
PromiseTask(EventExecutor executor, Runnable runnable, V result) { this(executor, toCallable(runnable, result)); }
@Override public void run() { if (!isPeriodic()) { super.run(); } else if (!isDone()) { try { // Its a periodic task so we need to ignore the return value task.call(); } catch (Throwable cause) { if (!tryFailureInternal(cause)) { logger.warn("Failure during execution of task", cause); } } } }
@Override public void run() { try { if (setUncancellableInternal()) { V result = task.call(); setSuccessInternal(result); } } catch (Throwable e) { setFailureInternal(e); } }
boolean cancelWithoutRemove(boolean mayInterruptIfRunning) { return super.cancel(mayInterruptIfRunning); }