<@UFJ3F2RA8> We haven’t completely settled on an A...
# arrow
s
@Joram Visser We haven’t completely settled on an API. Currently we only expose
startCoroutineCancellable
which you can use as
unsafeRunAsyncCancellable
, or
startCoroutine
from the Kotlin Standard Library. Which can be used as
Copy code
suspend { program() }.startCoroutine(Continuation(ctx) { r -> println(r) })

val disposable = suspend { program() }.startCoroutineCancellable(Continuation(ctx) { r -> println(r) })
The API I have prototype looks something like this:
Copy code
/* By default installed on Computation pool, and `e.printStackTrace()` as as async error handler which is also invoked in extremely rare situations */
val enviroment: Enviroment = Enviroment()

enviroment.unsafeRunAsync(::program) { r -> println(r) }
enviroment.unsafeRunAsyncCancellable(::program) { r -> println(r) }
...
Environment is like a combination of what we have today as
Enviroment
and
UnsafeRun
. All feedback is very welcome 🙂