getOrElse

inline fun <T> ChannelResult<T>.getOrElse(onFailure: (exception: Throwable?) -> T): T

Returns the encapsulated value if this instance represents success or the result of onFailure function for the encapsulated Throwable exception if it is failed or closed result.

Sources

common source
Link copied to clipboard