Patrick
10/20/2020, 12:43 PMJilles van Gurp
10/20/2020, 1:21 PMJvmStatic
annotations. Should be doable on paper but not sure whether you'd want to. But doing some kind of launch
and wrapping the returned job with a Java Future
sounds like it might work.Jilles van Gurp
10/20/2020, 1:22 PMPatrick
10/20/2020, 1:22 PMPatrick
10/20/2020, 1:23 PMdiesieben07
10/20/2020, 1:29 PMFuture
, it's a terrible type and basically unusable.
Check out kotlinx-coroutines-jdk8, which lets you convert between coroutine types such as Deferred
and Java's CompletableFuture
. Then you can provide a secondary API based on CompletableFuture
for the Java consumers.diesieben07
10/20/2020, 1:29 PMPatrick
10/20/2020, 1:30 PMaraqnid
10/20/2020, 2:03 PMandylamax
10/20/2020, 4:02 PMMark Gilchrist
10/21/2020, 7:53 AMBuildersKt.launch(GlobalScope.INSTANCE,
Dispatchers.getMain(),
CoroutineStart.DEFAULT,
(coroutineScope, continuation) -> suspendFunction(arguments)
);
Mark Gilchrist
10/21/2020, 7:54 AM