concurrent / org.apache.tuweni.concurrent / AsyncResult / get

get

@Nullable abstract fun get(): T? (source)

Waits if necessary for the computation to complete, and then retrieves its result.

Exceptions

CompletionException - If the computation threw an exception.

InterruptedException - If the current thread was interrupted while waiting.

Return
The computed result.

@Nullable abstract fun get(timeout: Long, unit: TimeUnit): T? (source)

Waits if necessary for at most the given time for the computation to complete, and then retrieves its result.

Parameters

timeout - The maximum time to wait.

unit - The time unit of the timeout argument.

Exceptions

CompletionException - If the computation threw an exception.

TimeoutException - If the wait timed out.

InterruptedException - If the current thread was interrupted while waiting.

Return
The computed result.