public static final class AbstractSharedExecutorMicrobenchmark.DelegateHarnessExecutor extends AbstractEventExecutor
executor(EventLoop)
with the EventLoop
used by Netty.Constructor and Description |
---|
DelegateHarnessExecutor(int maxThreads,
String prefix) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit) |
void |
execute(Runnable command) |
static void |
executor(EventLoop service)
Set the executor (in the form of an
EventLoop ) which JMH will use. |
boolean |
inEventLoop()
Calls
EventExecutor.inEventLoop(Thread) with Thread.currentThread() as argument |
boolean |
inEventLoop(Thread thread)
|
boolean |
isShutdown() |
boolean |
isShuttingDown()
Returns
true if and only if all EventExecutor s managed by this EventExecutorGroup
are being shut down gracefuclly or was shut down. |
boolean |
isTerminated() |
<V> ProgressivePromise<V> |
newProgressivePromise()
Create a new
ProgressivePromise . |
<V> Promise<V> |
newPromise()
Return a new
Promise . |
void |
shutdown()
Deprecated.
|
Future<?> |
shutdownGracefully(long quietPeriod,
long timeout,
TimeUnit unit)
Signals this executor that the caller wants the executor to be shut down.
|
Future<?> |
terminationFuture()
Returns the
Future which is notified when all EventExecutor s managed by this
EventExecutorGroup have been terminated. |
iterator, newFailedFuture, newSucceededFuture, newTaskFor, newTaskFor, next, parent, safeExecute, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay, shutdownGracefully, shutdownNow, submit, submit, submit
invokeAll, invokeAll, invokeAny, invokeAny
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
invokeAll, invokeAll, invokeAny, invokeAny
forEach, spliterator
public DelegateHarnessExecutor(int maxThreads, String prefix)
public static void executor(EventLoop service)
EventLoop
) which JMH will use.
This must be called before JMH requires an executor to execute objects.
service
- Used as an executor by JMH to run benchmarks.public boolean inEventLoop()
EventExecutor
EventExecutor.inEventLoop(Thread)
with Thread.currentThread()
as argumentinEventLoop
in interface EventExecutor
inEventLoop
in class AbstractEventExecutor
public boolean inEventLoop(Thread thread)
EventExecutor
public Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit)
EventExecutorGroup
EventExecutorGroup.isShuttingDown()
starts to return true
, and the executor prepares to shut itself down.
Unlike EventExecutorGroup.shutdown()
, graceful shutdown ensures that no tasks are submitted for 'the quiet period'
(usually a couple seconds) before it shuts itself down. If a task is submitted during the quiet period,
it is guaranteed to be accepted and the quiet period will start over.quietPeriod
- the quiet period as described in the documentationtimeout
- the maximum amount of time to wait until the executor is EventExecutorGroup.shutdown()
regardless if a task was submitted during the quiet periodunit
- the unit of quietPeriod
and timeout
EventExecutorGroup.terminationFuture()
public Future<?> terminationFuture()
EventExecutorGroup
Future
which is notified when all EventExecutor
s managed by this
EventExecutorGroup
have been terminated.@Deprecated public void shutdown()
shutdown
in interface EventExecutorGroup
shutdown
in interface ExecutorService
shutdown
in class AbstractEventExecutor
public boolean isShuttingDown()
EventExecutorGroup
true
if and only if all EventExecutor
s managed by this EventExecutorGroup
are being shut down gracefuclly or was shut down.public boolean isShutdown()
public boolean isTerminated()
public boolean awaitTermination(long timeout, TimeUnit unit)
public void execute(Runnable command)
public <V> Promise<V> newPromise()
EventExecutor
Promise
.newPromise
in interface EventExecutor
newPromise
in class AbstractEventExecutor
public <V> ProgressivePromise<V> newProgressivePromise()
EventExecutor
ProgressivePromise
.newProgressivePromise
in interface EventExecutor
newProgressivePromise
in class AbstractEventExecutor
Copyright © 2008–2017 The Netty Project. All rights reserved.