tuweni / 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
T?: 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 - Long: The maximum time to wait.

unit - TimeUnit!: 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
T?: The computed result.