|Modifier and Type||Method and Description|
Close the executor.
Safely execute some blocking code.
<T> void executeBlocking(Handler<Future<T>> blockingCodeHandler, boolean ordered, Handler<AsyncResult<T>> resultHandler)
Executes the blocking code in the handler
blockingCodeHandler using a thread from the worker pool.
When the code is complete the handler
resultHandler will be called with the result on the original context
(i.e. on the original event loop of the caller).
Future instance is passed into
blockingCodeHandler. When the blocking code successfully completes,
the handler should call the
Future.complete(Object) method, or the
method if it failed.
blockingCodeHandler the current context remains the original context and therefore any task
scheduled in the
blockingCodeHandler will be executed on the this context and not on the worker thread.
T- the type of the result
blockingCodeHandler- handler representing the blocking code to run
resultHandler- handler that will be called when the blocking code is complete
ordered- if true then if executeBlocking is called several times on the same context, the executions for that context will be executed serially, not in parallel. if false then they will be no ordering guarantees
default <T> void executeBlocking(Handler<Future<T>> blockingCodeHandler, Handler<AsyncResult<T>> resultHandler)
executeBlocking(Handler, boolean, Handler)called with ordered = true.
default void close()
Copyright © 2018 Eclipse. All rights reserved.