tuweni / org.apache.tuweni.concurrent / AsyncResult / executeBlocking

executeBlocking

open static fun <T : Any> executeBlocking(fn: Supplier<T>): AsyncResult<T> (source)

Returns a result that, after the given blocking function executes asynchronously on ForkJoinPool#commonPool() and returns a result, completes when the returned result completes, with the same value or exception.

Parameters

fn - The function returning a result.

- The type of the returned result's value.

Return
A new result.

open static fun <T : Any> executeBlocking(executor: Executor, fn: Supplier<T>): AsyncResult<T> (source)

Returns a result that, after the given blocking function executes asynchronously on an Executor and returns a result, completes when the returned result completes, with the same value or exception.

Parameters

executor - The executor.

fn - The function returning a result.

- The type of the returned result's value.

Return
A new result.

open static fun <T : Any> executeBlocking(vertx: Vertx, fn: Supplier<T>): AsyncResult<T> (source)

Returns a result that, after the given blocking function executes asynchronously on a vertx context and returns a result, completes when the returned result completes, with the same value or exception.

Parameters

vertx - The vertx context.

fn - The function returning a result.

- The type of the returned result's value.

Return
A new result.

open static fun <T : Any> executeBlocking(executor: WorkerExecutor, fn: Supplier<T>): AsyncResult<T> (source)

Returns a result that, after the given blocking function executes asynchronously on a vertx executor and returns a result, completes when the returned result completes, with the same value or exception.

Parameters

executor - A vertx executor.

fn - The function returning a result.

- The type of the returned result's value.

Return
A new result.