runSync

open fun runSync(defaultValueOnFailure: A, block: suspend Effect.RunDSL<A>.() -> Unit = {}): A

Executes the computation synchronously, returning a default value on failure.

Return

The result of the computation, or the default value if it fails.

Parameters

defaultValueOnFailure

The default value to return if the computation fails.

block

A DSL block to customize the handling of success and failure outcomes.


open fun runSync(defaultValueOnFailure: suspend () -> A, block: suspend Effect.RunDSL<A>.() -> Unit = {}): A

Executes the computation synchronously, using a suspendable default value provider on failure.

Return

The result of the computation, or the default value if it fails.

Parameters

defaultValueOnFailure

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.