Class WorkerExecutor
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate, Measured
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclose()Close the executor.boolean<T> Single<T> executeBlocking(Callable<T> blockingCodeHandler) LikeexecuteBlocking(Callable, boolean)called with ordered = true.<T> Maybe<T> executeBlocking(Callable<T> blockingCodeHandler, boolean ordered) Safely execute some blocking code.inthashCode()booleanWhether the metrics are enabled for this measured objectstatic WorkerExecutorrxClose()Close the executor.<T> Single<T> rxExecuteBlocking(Callable<T> blockingCodeHandler) LikeexecuteBlocking(Callable, boolean)called with ordered = true.<T> Maybe<T> rxExecuteBlocking(Callable<T> blockingCodeHandler, boolean ordered) Safely execute some blocking code.toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
WorkerExecutor
-
WorkerExecutor
-
-
Method Details
-
toString
-
equals
-
hashCode
-
getDelegate
- Specified by:
getDelegatein interfaceMeasured- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
isMetricsEnabled
public boolean isMetricsEnabled()Whether the metrics are enabled for this measured object- Specified by:
isMetricsEnabledin interfaceMeasured- Returns:
trueif metrics are enabled
-
close
-
rxClose
-
executeBlocking
Safely execute some blocking code.Executes the blocking code in the handler
blockingCodeHandlerusing a thread from the worker pool.The returned future will be completed with the result on the original context (i.e. on the original event loop of the caller) or failed when the handler throws an exception.
In the
blockingCodeHandlerthe current context remains the original context and therefore any task scheduled in theblockingCodeHandlerwill be executed on this context and not on the worker thread.- Parameters:
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 guarantees- Returns:
- a future notified with the result
-
rxExecuteBlocking
Safely execute some blocking code.Executes the blocking code in the handler
blockingCodeHandlerusing a thread from the worker pool.The returned future will be completed with the result on the original context (i.e. on the original event loop of the caller) or failed when the handler throws an exception.
In the
blockingCodeHandlerthe current context remains the original context and therefore any task scheduled in theblockingCodeHandlerwill be executed on this context and not on the worker thread.- Parameters:
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 guarantees- Returns:
- a future notified with the result
-
executeBlocking
LikeexecuteBlocking(Callable, boolean)called with ordered = true.- Parameters:
blockingCodeHandler-- Returns:
-
rxExecuteBlocking
LikeexecuteBlocking(Callable, boolean)called with ordered = true.- Parameters:
blockingCodeHandler-- Returns:
-
newInstance
-