Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<WorkerExecutor> |
__TYPE_ARG |
Constructor and Description |
---|
WorkerExecutor(Object delegate) |
WorkerExecutor(WorkerExecutor delegate) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the executor.
|
boolean |
equals(Object o) |
<T> void |
executeBlocking(Handler<Promise<T>> blockingCodeHandler,
boolean ordered,
Handler<AsyncResult<T>> resultHandler)
Safely execute some blocking code.
|
<T> void |
executeBlocking(Handler<Promise<T>> blockingCodeHandler,
Handler<AsyncResult<T>> resultHandler)
|
<T> Observable<T> |
executeBlockingObservable(Handler<Promise<T>> blockingCodeHandler)
Deprecated.
|
<T> Observable<T> |
executeBlockingObservable(Handler<Promise<T>> blockingCodeHandler,
boolean ordered)
Deprecated.
|
WorkerExecutor |
getDelegate() |
int |
hashCode() |
boolean |
isMetricsEnabled()
Whether the metrics are enabled for this measured object
|
static WorkerExecutor |
newInstance(WorkerExecutor arg) |
<T> Single<T> |
rxExecuteBlocking(Handler<Promise<T>> blockingCodeHandler)
|
<T> Single<T> |
rxExecuteBlocking(Handler<Promise<T>> blockingCodeHandler,
boolean ordered)
Safely execute some blocking code.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
newInstance
public static final io.vertx.lang.rx.TypeArg<WorkerExecutor> __TYPE_ARG
public WorkerExecutor(WorkerExecutor delegate)
public WorkerExecutor(Object delegate)
public WorkerExecutor getDelegate()
getDelegate
in interface Measured
public boolean isMetricsEnabled()
isMetricsEnabled
in interface Measured
true
if metrics are enabledpublic <T> void executeBlocking(Handler<Promise<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).
A Future
instance is passed into blockingCodeHandler
. When the blocking code successfully completes,
the handler should call the Promise.complete(T)
or Promise.complete(T)
method, or the Promise.fail(java.lang.Throwable)
method if it failed.
In the 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.
blockingCodeHandler
- handler representing the blocking code to runordered
- 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 guaranteesresultHandler
- handler that will be called when the blocking code is complete@Deprecated public <T> Observable<T> executeBlockingObservable(Handler<Promise<T>> blockingCodeHandler, boolean ordered)
rxExecuteBlocking(io.vertx.core.Handler<io.vertx.rxjava.core.Promise<T>>, boolean)
instead
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).
A Future
instance is passed into blockingCodeHandler
. When the blocking code successfully completes,
the handler should call the Promise.complete(T)
or Promise.complete(T)
method, or the Promise.fail(java.lang.Throwable)
method if it failed.
In the 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.
blockingCodeHandler
- handler representing the blocking code to runordered
- 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 guaranteespublic <T> Single<T> rxExecuteBlocking(Handler<Promise<T>> blockingCodeHandler, boolean ordered)
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).
A Future
instance is passed into blockingCodeHandler
. When the blocking code successfully completes,
the handler should call the Promise.complete(T)
or Promise.complete(T)
method, or the Promise.fail(java.lang.Throwable)
method if it failed.
In the 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.
blockingCodeHandler
- handler representing the blocking code to runordered
- 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 guaranteespublic <T> void executeBlocking(Handler<Promise<T>> blockingCodeHandler, Handler<AsyncResult<T>> resultHandler)
executeBlocking(io.vertx.core.Handler<io.vertx.rxjava.core.Promise<T>>, boolean, io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>)
called with ordered = true.blockingCodeHandler
- resultHandler
- @Deprecated public <T> Observable<T> executeBlockingObservable(Handler<Promise<T>> blockingCodeHandler)
rxExecuteBlocking(io.vertx.core.Handler<io.vertx.rxjava.core.Promise<T>>, boolean)
insteadexecuteBlocking(io.vertx.core.Handler<io.vertx.rxjava.core.Promise<T>>, boolean, io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>)
called with ordered = true.blockingCodeHandler
- public <T> Single<T> rxExecuteBlocking(Handler<Promise<T>> blockingCodeHandler)
executeBlocking(io.vertx.core.Handler<io.vertx.rxjava.core.Promise<T>>, boolean, io.vertx.core.Handler<io.vertx.core.AsyncResult<T>>)
called with ordered = true.blockingCodeHandler
- public void close()
public static WorkerExecutor newInstance(WorkerExecutor arg)
Copyright © 2020 Eclipse. All rights reserved.