https://kotlinlang.org logo
e

elizarov

05/04/2017, 6:44 AM
The short answer is that coroutines in Kotlin are stackful in the same sense as in Quasar. Kotlin
suspend fun
are are direct analogue of Quasar’s
@Suspendable
(or
throws SuspendExecution
) functions and suspension can happen at any depth in the stack as long as the whole call chain is marked with
suspend
which is enforced by compiler (you cannot invoke suspending function from a regular one). Quasar enforces that too, but it is using
throws SuspendExecution
and Java checked exceptions logic for this purpose, which is a little bit weaker form of enforcement.