run
Executes the computation asynchronously, returning a default value on failure.
Return
The result of the computation, or the default value if it fails.
Parameters
default Value On Failure
The default value to return if the computation fails.
block
A DSL block to customize the handling of success and failure outcomes.
open suspend fun run(defaultValueOnFailure: suspend () -> A, block: suspend Effect.RunDSL<A>.() -> Unit = {}): A
Executes the computation asynchronously, using a suspendable default value provider on failure.
Return
The result of the computation, or the default value if it fails.
Parameters
default Value On Failure
A suspendable function that provides the default value if the computation fails.
block
A DSL block to customize the handling of success and failure outcomes.