getOrThrow
Returns the encapsulated T if the operation succeeded, or throws the encapsulated exception if it failed.
Example:
val result = channel.tryReceive()
if (result.isSuccess) {
println("Successfully received the value ${result.getOrThrow()}")
}
Content copied to clipboard
Throws
if the operation failed, but the channel was not closed with a cause.