Search code examples
kotlincontinuationskotlinx.coroutinesdelimited-continuations

Are continuations in Kotlin usable yet? Any examples available?


There is an package in Kotlin for continuations, but it's marked as experimental. There is no documentation other than the API, and no tutorial or examples anywhere that I could find. Does anyone know if it's already usable? What would be an example of its usage?


Solution

  • The Continuation interface is a part of coroutines support API in the standard library. You can start exploring the coroutines from the documentation page, or from the kotlinx.coroutines library repository, which contains an extensive coroutine programming guide.

    Coroutines are experimental in Kotlin 1.1 and 1.2, but there was an announcement that they are going to stabilize in 1.3.