arrow-fx / arrow.fx / IO / unsafeRunAsync


fun unsafeRunAsync(cb: (Either<Throwable, A>) -> Unit): Unit

unsafeRunAsync allows you to run any IO and receive the values in a callback cb and thus has the ability to run NonBlocking but that depends on the implementation. When the underlying effects/program runs blocking on the callers thread this method will run blocking.

To start this on NonBlocking use NonBlocking.shift().followedBy(io).unsafeRunAsync { }.


cb - the callback that is called with the computations result represented as an Either.

See Also



Do you like Arrow?

Arrow Org