Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WorkerExecutor

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.

Hierarchy

  • WorkerExecutor

Implements

Index

Methods

close

  • Close the executor.

    Returns PromiseLike<void>

  • Close the executor.

    Parameters

    Returns void

executeBlocking

  • 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 {@link Promise#complete} or {@link Promise#complete} method, or the {@link Promise#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.

    Type parameters

    • T

    Parameters

    Returns PromiseLike<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 {@link Promise#complete} or {@link Promise#complete} method, or the {@link Promise#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.

    Type parameters

    • T

    Parameters

    Returns void

  • Like {@link WorkerExecutor#executeBlocking} called with ordered = true.

    Type parameters

    • T

    Parameters

    Returns PromiseLike<T>

  • Like {@link WorkerExecutor#executeBlocking} called with ordered = true.

    Type parameters

    • T

    Parameters

    Returns void

isMetricsEnabled

  • isMetricsEnabled(): boolean
  • Whether the metrics are enabled for this measured object

    Returns boolean

Generated using TypeDoc