vertx / io.vertx.reactivex.core / WorkerExecutor

WorkerExecutor

open class WorkerExecutor : Measured

An executor for executing blocking code in Vert.x .

It provides the same executeBlocking operation than io.vertx.reactivex.core.Context and io.vertx.reactivex.core.Vertx but on a separate worker pool.

NOTE: This class has been automatically generated from the io.vertx.core.WorkerExecutor non RX-ified interface using Vert.x codegen.

Constructors

<init>

WorkerExecutor(delegate: WorkerExecutor)

Properties

__TYPE_ARG

static val __TYPE_ARG: TypeArg<WorkerExecutor>

Functions

close

open fun close(): Unit

Close the executor.

equals

open fun equals(other: Any?): Boolean

executeBlocking

open fun <T : Any> executeBlocking(blockingCodeHandler: Handler<Future<T>>, ordered: Boolean, resultHandler: Handler<AsyncResult<T>>): Unit

Safely execute some blocking code.

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 io.vertx.reactivex.core.Future#complete or io.vertx.reactivex.core.Future#complete method, or the io.vertx.reactivex.core.Future#fail 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.

open fun <T : Any> executeBlocking(blockingCodeHandler: Handler<Future<T>>, resultHandler: Handler<AsyncResult<T>>): Unit

Like io.vertx.reactivex.core.WorkerExecutor#executeBlocking called with ordered = true.

getDelegate

open fun getDelegate(): WorkerExecutor

hashCode

open fun hashCode(): Int

isMetricsEnabled

open fun isMetricsEnabled(): Boolean

Whether the metrics are enabled for this measured object

newInstance

open static fun newInstance(arg: WorkerExecutor): WorkerExecutor

rxExecuteBlocking

open fun <T : Any> rxExecuteBlocking(blockingCodeHandler: Handler<Future<T>>, ordered: Boolean): Single<T>

Safely execute some blocking code.

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 io.vertx.reactivex.core.Future#complete or io.vertx.reactivex.core.Future#complete method, or the io.vertx.reactivex.core.Future#fail 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.

open fun <T : Any> rxExecuteBlocking(blockingCodeHandler: Handler<Future<T>>): Single<T>

Like io.vertx.reactivex.core.WorkerExecutor#executeBlocking called with ordered = true.

toString

open fun toString(): String