Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Really?

How do you call Kotlin co-routines from Java code without wrapper types?



Suspend functions appear as regular JVM methods with an extra Continuation parameter. Tools like runBlocking make them straightforward to call from Java.

My main point was that you can use Java code as is without modifications from Kotlin, and that if you wanted you could have Java code in your project and it will work just fine. Of course if you wanna start calling co-routines from the Java part of your project to the Kotlin part, hey that's up to you.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: