Thread
#multiplatform
    m

    Matteo Wohlrapp

    2 years ago
    Does anyone know if Kotlin suspend functions actually suspend on iOS and if so, how is it implemented on iOS?
    louiscad

    louiscad

    2 years ago
    About the same way as on the JVM. It's callbacks chains under the hood.
    m

    Matteo Wohlrapp

    2 years ago
    Thanks!
    @louiscad sorry to bother you again but I couldn`t find more information about it in the documentation. Are they actually suspending or just blocking the thread?
    louiscad

    louiscad

    2 years ago
    They are suspending, which under the hood, is waiting for a callback.
    You have access to
    Continuation
    in Kotlin/Native as well @Matteo Wohlrapp
    suspendCancellableCoroutine
    and other suspend primitives wouldn't be able to work just like on JVM and JS without that.
    m

    Matteo Wohlrapp

    2 years ago
    Ok, thanks a lot 😁