private void finishPendingTasks(boolean cancel) { runPendingTasks(); if (cancel) { // Cancel all scheduled tasks that are left. loop.cancelScheduledTasks(); } }
/** * Run all pending scheduled tasks in the {@link EventLoop} for this {@link Channel} and return the * {@code nanoseconds} when the next scheduled task is ready to run. If no other task was scheduled it will return * {@code -1}. */ public long runScheduledPendingTasks() { try { return loop.runScheduledTasks(); } catch (Exception e) { recordException(e); return loop.nextScheduledTask(); } }
long runScheduledTasks() { long time = AbstractScheduledEventExecutor.nanoTime(); for (;;) { Runnable task = pollScheduledTask(time); if (task == null) { return nextScheduledTaskNano(); } task.run(); } }
/** * Run all tasks (which also includes scheduled tasks) that are pending in the {@link EventLoop} * for this {@link Channel} */ public void runPendingTasks() { try { loop.runTasks(); } catch (Exception e) { recordException(e); } try { loop.runScheduledTasks(); } catch (Exception e) { recordException(e); } }
@Override public ChannelFuture register(Channel channel) { return register(new DefaultChannelPromise(channel, this)); }
long nextScheduledTask() { return nextScheduledTaskNano(); }
/** * Run all tasks (which also includes scheduled tasks) that are pending in the {@link EventLoop} * for this {@link Channel} */ public void runPendingTasks() { try { loop.runTasks(); } catch (Exception e) { recordException(e); } try { loop.runScheduledTasks(); } catch (Exception e) { recordException(e); } }
@Override public ChannelFuture register(Channel channel) { return register(new DefaultChannelPromise(channel, this)); }
long nextScheduledTask() { return nextScheduledTaskNano(); }
long runScheduledTasks() { long time = AbstractScheduledEventExecutor.nanoTime(); for (;;) { Runnable task = pollScheduledTask(time); if (task == null) { return nextScheduledTaskNano(); } task.run(); } }
/** * Run all pending scheduled tasks in the {@link EventLoop} for this {@link Channel} and return the * {@code nanoseconds} when the next scheduled task is ready to run. If no other task was scheduled it will return * {@code -1}. */ public long runScheduledPendingTasks() { try { return loop.runScheduledTasks(); } catch (Exception e) { recordException(e); return loop.nextScheduledTask(); } }
/** * Run all tasks (which also includes scheduled tasks) that are pending in the {@link EventLoop} * for this {@link Channel} */ public void runPendingTasks() { try { loop.runTasks(); } catch (Exception e) { recordException(e); } try { loop.runScheduledTasks(); } catch (Exception e) { recordException(e); } }
/** * Register this {@code Channel} on its {@link EventLoop}. */ public void register() throws Exception { ChannelFuture future = loop.register(this); assert future.isDone(); Throwable cause = future.cause(); if (cause != null) { PlatformDependent.throwException(cause); } }
private void finishPendingTasks(boolean cancel) { runPendingTasks(); if (cancel) { // Cancel all scheduled tasks that are left. loop.cancelScheduledTasks(); } }
long nextScheduledTask() { return nextScheduledTaskNano(); }
long runScheduledTasks() { long time = AbstractScheduledEventExecutor.nanoTime(); for (;;) { Runnable task = pollScheduledTask(time); if (task == null) { return nextScheduledTaskNano(); } task.run(); } }
/** * Run all pending scheduled tasks in the {@link EventLoop} for this {@link Channel} and return the * {@code nanoseconds} when the next scheduled task is ready to run. If no other task was scheduled it will return * {@code -1}. */ public long runScheduledPendingTasks() { try { return loop.runScheduledTasks(); } catch (Exception e) { recordException(e); return loop.nextScheduledTask(); } }
/** * Run all tasks (which also includes scheduled tasks) that are pending in the {@link EventLoop} * for this {@link Channel} */ public void runPendingTasks() { try { loop.runTasks(); } catch (Exception e) { recordException(e); } try { loop.runScheduledTasks(); } catch (Exception e) { recordException(e); } }
@Override public ChannelFuture register(Channel channel) { return register(new DefaultChannelPromise(channel, this)); }
private void finishPendingTasks(boolean cancel) { runPendingTasks(); if (cancel) { // Cancel all scheduled tasks that are left. loop.cancelScheduledTasks(); } }