WorkerExecutor

An executor for executing blocking code in Vert.x .<p>

It provides the same executeBlocking operation than @see \io\vertx\jphp\core\Context and

see

but on a separate worker pool.

package

Default

Methods

__construct

__construct() 

Close the executor.

close() : void

Like @see \io\vertx\jphp\core\WorkerExecutor::executeBlocking called with ordered = true.

executeBlocking( $arg0,  $arg1,  $arg2 = null) : void

param $blockingCodeHandler [callable] param $resultHandler [callable] executeBlocking($blockingCodeHandler, $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 @see \io\vertx\jphp\core\Future::complete or @see \io\vertx\jphp\core\Future::complete method, or the @see \io\vertx\jphp\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. param $blockingCodeHandler [callable] handler representing the blocking code to run param $ordered [boolean] 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 param $resultHandler [callable] handler that will be called when the blocking code is complete executeBlocking($blockingCodeHandler, $ordered, $resultHandler)

Arguments

$arg0

callable

$arg1

callable | boolean

$arg2

callable

Whether the metrics are enabled for this measured object

isMetricsEnabled() : boolean

Response

boolean

{@code true} if metrics are enabled