https://kotlinlang.org logo
Title
j

julioyg

11/01/2018, 8:48 AM
Hi guys, is there any doc around on how to execute a suspend function from Java?
g

gildor

11/01/2018, 8:50 AM
it’s nor supported officially You have to pass Continuation instance
j

julioyg

11/01/2018, 8:54 AM
I've seen that, but I dunno how to do that 😅
well, oh
it's enough just implementing the interface
g

gildor

11/01/2018, 9:26 AM
Yes, you can pass own Continuation instance
j

julioyg

11/01/2018, 10:26 AM
oh, nice!, thanks
g

gildor

11/01/2018, 10:40 AM
Oh. of it’s fine for you, than of course, you need special async API for java I thought that question was about calling some existing API from pure java project
j

julioyg

11/01/2018, 11:02 AM
nope, it's the same project, some java, some kotlin... in our way to go fully kotlin tho
g

gildor

11/01/2018, 11:03 AM
Yeah, than you just need some future-like abstraction for Java. In our case we use RxJava adapter for coroutines to use from Java
j

julioyg

11/01/2018, 7:26 PM
oh, thanks, that's actually a great idea