Refine search
@Override public ChannelFuture shutdownOutput(final ChannelPromise promise) { EventLoop loop = eventLoop(); if (loop.inEventLoop()) { shutdownOutput0(promise); } else { loop.execute(new Runnable() { @Override public void run() { shutdownOutput0(promise); } }); } return promise; }
@Override public ChannelFuture shutdownInput(final ChannelPromise promise) { EventLoop loop = eventLoop(); if (loop.inEventLoop()) { shutdownInput0(promise); } else { loop.execute(new Runnable() { @Override public void run() { shutdownInput0(promise); } }); } return promise; }
@Override public ChannelFuture shutdownInput(final ChannelPromise promise) { EventLoop loop = eventLoop(); if (loop.inEventLoop()) { shutdownInput0(promise); } else { loop.execute(new Runnable() { @Override public void run() { shutdownInput0(promise); } }); } return promise; }
@Override public void release() { if (!eventLoop.inEventLoop()) { eventLoop.execute(this::doRelease); } else { doRelease(); } }
@Override public void call() { if (channel.eventLoop().inEventLoop()) { run(); } else { channel.eventLoop().execute(this); } } }
/** * Set read pending to {@code false}. */ protected final void clearReadPending() { if (isRegistered()) { EventLoop eventLoop = eventLoop(); if (eventLoop.inEventLoop()) { readPending = false; } else { eventLoop.execute(clearReadPendingRunnable); } } else { // Best effort if we are not registered yet clear readPending. This happens during channel initialization. readPending = false; } } }
/** * @deprecated Use {@link #clearReadPending()} if appropriate instead. * No longer supported. */ @Deprecated protected void setReadPending(final boolean readPending) { if (isRegistered()) { EventLoop eventLoop = eventLoop(); if (eventLoop.inEventLoop()) { this.readPending = readPending; } else { eventLoop.execute(new Runnable() { @Override public void run() { AbstractOioChannel.this.readPending = readPending; } }); } } else { this.readPending = readPending; } }
private void addToSpliceQueue(final SpliceInTask task) { EventLoop eventLoop = eventLoop(); if (eventLoop.inEventLoop()) { addToSpliceQueue0(task); } else { eventLoop.execute(new Runnable() { @Override public void run() { addToSpliceQueue0(task); } }); } }
@Override public ChannelFuture shutdownOutput(final ChannelPromise promise) { EventLoop loop = eventLoop(); if (loop.inEventLoop()) { shutdownOutput0(promise); } else { loop.execute(new Runnable() { @Override public void run() { shutdownOutput0(promise); } }); } return promise; }
@Override public ChannelFuture shutdownInput(final ChannelPromise promise) { EventLoop loop = eventLoop(); if (loop.inEventLoop()) { shutdownInput0(promise); } else { loop.execute(new Runnable() { @Override public void run() { shutdownInput0(promise); } }); } return promise; }
@Override public ChannelFuture shutdownInput(final ChannelPromise promise) { EventLoop loop = eventLoop(); if (loop.inEventLoop()) { shutdownInput0(promise); } else { loop.execute(new Runnable() { @Override public void run() { shutdownInput0(promise); } }); } return promise; }
@Override public ChannelFuture shutdownInput(final ChannelPromise promise) { EventLoop loop = eventLoop(); if (loop.inEventLoop()) { shutdownInput0(promise); } else { loop.execute(new Runnable() { @Override public void run() { shutdownInput0(promise); } }); } return promise; }
/** * Set read pending to {@code false}. */ protected final void clearReadPending() { if (isRegistered()) { EventLoop eventLoop = eventLoop(); if (eventLoop.inEventLoop()) { readPending = false; } else { eventLoop.execute(clearReadPendingRunnable); } } else { // Best effort if we are not registered yet clear readPending. This happens during channel initialization. readPending = false; } } }
@Override public ChannelFuture shutdownOutput(final ChannelPromise promise) { final EventLoop loop = eventLoop(); if (loop.inEventLoop()) { ((AbstractUnsafe) unsafe()).shutdownOutput(promise); } else { loop.execute(new Runnable() { @Override public void run() { ((AbstractUnsafe) unsafe()).shutdownOutput(promise); } }); } return promise; }
@Override public void close(Throwable cause) { requireNonNull(cause, "cause"); if (cause instanceof CancelledSubscriptionException) { throw new IllegalArgumentException("cause: " + cause + " (must use Subscription.cancel())"); } if (eventLoop.inEventLoop()) { doClose(cause); } else { eventLoop.execute(() -> doClose(cause)); } }
/** * @deprecated Use {@link #clearReadPending()} if appropriate instead. * No longer supported. */ @Deprecated protected void setReadPending(final boolean readPending) { if (isRegistered()) { EventLoop eventLoop = eventLoop(); if (eventLoop.inEventLoop()) { this.readPending = readPending; } else { eventLoop.execute(new Runnable() { @Override public void run() { AbstractOioChannel.this.readPending = readPending; } }); } } else { this.readPending = readPending; } }
/** * Set read pending to {@code false}. */ protected final void clearReadPending() { if (isRegistered()) { EventLoop eventLoop = eventLoop(); if (eventLoop.inEventLoop()) { clearReadPending0(); } else { eventLoop.execute(clearReadPendingRunnable); } } else { // Best effort if we are not registered yet clear readPending. This happens during channel initialization. // NB: We only set the boolean field instead of calling clearReadPending0(), because the SelectionKey is // not set yet so it would produce an assertion failure. readPending = false; } }
@Override void addObject(T obj) { wroteAny = true; if (eventLoop.inEventLoop()) { doAddObject(obj); } else { eventLoop.execute(() -> doAddObject(obj)); } }
/** * @deprecated Use {@link #clearReadPending()} if appropriate instead. * No longer supported. */ @Deprecated protected void setReadPending(final boolean readPending) { if (isRegistered()) { EventLoop eventLoop = eventLoop(); if (eventLoop.inEventLoop()) { setReadPending0(readPending); } else { eventLoop.execute(new Runnable() { @Override public void run() { setReadPending0(readPending); } }); } } else { // Best effort if we are not registered yet clear readPending. // NB: We only set the boolean field instead of calling clearReadPending0(), because the SelectionKey is // not set yet so it would produce an assertion failure. this.readPending = readPending; } }
private void addToSpliceQueue(final SpliceInTask task) { EventLoop eventLoop = eventLoop(); if (eventLoop.inEventLoop()) { addToSpliceQueue0(task); } else { eventLoop.execute(new Runnable() { @Override public void run() { addToSpliceQueue0(task); } }); } }