orElse
Run the given transaction and fallback to the other one if the first one calls retry.
import arrow.fx.stm.atomically
import arrow.fx.stm.stm
suspend fun main() {
//sampleStart
val result = atomically {
stm { retry() } orElse { "Alternative" }
}
//sampleEnd
println("Result $result")
}
Content copied to clipboard