io.vertx.rxjava.core

## Class WorkerExecutor

- java.lang.Object
- - io.vertx.rxjava.core.WorkerExecutor

- All Implemented Interfaces:
    Measured

      public class WorkerExecutor
      extends Object
      implements Measured

  An executor for executing blocking code in Vert.x .

  It provides the same `executeBlocking` operation than `Context` and `Vertx` but on a separate worker pool.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<WorkerExecutor>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WorkerExecutor(Object delegate)`
    `WorkerExecutor(WorkerExecutor delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close the executor.
    `void` | `close(Handler<AsyncResult<Void>> handler)` Close the executor.
    `boolean` | `equals(Object o)`
    `<T> void` | `executeBlocking(Handler<Promise<T>> blockingCodeHandler)` Like `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.
    `<T> void` | `executeBlocking(Handler<Promise<T>> blockingCodeHandler, boolean ordered)` Safely execute some blocking code.
    `<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)` Like `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.
    `WorkerExecutor` | `getDelegate()`
    `int` | `hashCode()`
    `boolean` | `isMetricsEnabled()` Whether the metrics are enabled for this measured object
    `static WorkerExecutor` | `newInstance(WorkerExecutor arg)`
    `Single<Void>` | `rxClose()` Close the executor.
    `<T> Single<T>` | `rxExecuteBlocking(Handler<Promise<T>> blockingCodeHandler)` Like `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.
    `<T> Single<T>` | `rxExecuteBlocking(Handler<Promise<T>> blockingCodeHandler, boolean ordered)` Safely execute some blocking code.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface io.vertx.rxjava.core.metrics.Measured

      `newInstance`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<WorkerExecutor> __TYPE_ARG

  - ### Constructor Detail

    - #### WorkerExecutor

          public WorkerExecutor(WorkerExecutor delegate)

    - #### WorkerExecutor

          public WorkerExecutor(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public WorkerExecutor getDelegate()

      Specified by:
        `getDelegate` in interface `Measured`

    - #### isMetricsEnabled

          public boolean isMetricsEnabled()

      Whether the metrics are enabled for this measured object
      Specified by:
        `isMetricsEnabled` in interface `Measured`
      Returns:
        `true` if metrics are enabled

    - #### executeBlocking

          public <T> void executeBlocking(Handler<Promise<T>> blockingCodeHandler,
                                          boolean ordered,
                                          Handler<AsyncResult<T>> resultHandler)

      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 `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.

      Parameters:
        `blockingCodeHandler` - handler representing the blocking code to run
        `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
        `resultHandler` - handler that will be called when the blocking code is complete

    - #### executeBlocking

          public <T> void executeBlocking(Handler<Promise<T>> blockingCodeHandler,
                                          boolean ordered)

      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 `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.

      Parameters:
        `blockingCodeHandler` - handler representing the blocking code to run
        `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

    - #### rxExecuteBlocking

          public <T> Single<T> rxExecuteBlocking(Handler<Promise<T>> blockingCodeHandler,
                                                 boolean ordered)

      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 `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.

      Parameters:
        `blockingCodeHandler` - handler representing the blocking code to run
        `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
      Returns:

    - #### executeBlocking

          public <T> void executeBlocking(Handler<Promise<T>> blockingCodeHandler,
                                          Handler<AsyncResult<T>> resultHandler)

      Like `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.
      Parameters:
        `blockingCodeHandler` -
        `resultHandler` -

    - #### executeBlocking

          public <T> void executeBlocking(Handler<Promise<T>> blockingCodeHandler)

      Like `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.
      Parameters:
        `blockingCodeHandler` -

    - #### rxExecuteBlocking

          public <T> Single<T> rxExecuteBlocking(Handler<Promise<T>> blockingCodeHandler)

      Like `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.
      Parameters:
        `blockingCodeHandler` -
      Returns:

    - #### close

          public void close(Handler<AsyncResult<Void>> handler)

      Close the executor.
      Parameters:
        `handler` - the completion handler

    - #### close

          public void close()

      Close the executor.

    - #### rxClose

          public Single<Void> rxClose()

      Close the executor.
      Returns:

    - #### newInstance

          public static WorkerExecutor newInstance(WorkerExecutor arg)

Copyright © 2022 Eclipse. All rights reserved.