@Suspendable open static fun <T : Any> awaitResult(consumer: Consumer<Handler<AsyncResult<T>>>): T
Invoke an asynchronous operation and obtain the result synchronous. The fiber will be blocked until the result is available. No kernel thread is blocked.
consumer - this should encapsulate the asynchronous operation. The handler is passed to it.
Return
the result
@Suspendable open static fun <T : Any> awaitResult(consumer: Consumer<Handler<AsyncResult<T>>>, timeout: Long): T
Invoke an asynchronous operation and obtain the result synchronous. The fiber will be blocked until the result is available. No kernel thread is blocked.
consumer - this should encapsulate the asynchronous operation. The handler is passed to it.
timeout - In milliseconds when to cancel the awaited result
Return
the result or null in case of a time out