executeWithTimeout

suspend fun <R : Any> ApiAction<R>.executeWithTimeout(timeout: Duration): R?

Awaits api execution and returns its result with timeout. This function is suspend-function.

Return

Api result as R. If the timeout exceeds, returns null.

Parameters

timeout

Timeout duration.

Throws

kotlinx.coroutines.CancellationException

Thrown when coroutine scope is cancelled.