jenji
08/03/2020, 4:50 PMSam Garfinkel
08/03/2020, 5:33 PMAsync
wrapper for my Kotlin API that mirrored the API, but instead used CompletableFuture
for returns from suspend functions and java.util.concurrent.Flow.Publisher
to wrap `Flow`sSam Garfinkel
08/03/2020, 5:35 PMSingle
or Mono
in the current Reactive Streams implementation so you’re stuck with FuturesSam Garfinkel
08/03/2020, 5:36 PMjenji
08/03/2020, 5:36 PMSam Garfinkel
08/03/2020, 5:40 PMjenji
08/03/2020, 5:41 PMjenji
08/03/2020, 5:49 PMbezrukov
08/03/2020, 6:08 PMI'm not seeing a way to go from a standard java threading model to coroutines.
suspendCancellableCoroutine
/ suspendCoroutine
is the way to transform any callback based model to coroutinesSam Garfinkel
08/03/2020, 6:17 PMcallbackFlow
to bridge Java -> Kotlin Coroutines for callback-style models. It’s generally not recommended to manually suspend or cancel coroutines.octylFractal
08/03/2020, 6:30 PMcallbackFlow
has way more overhead than necessary, and manually suspending is the right way to gojenji
08/03/2020, 6:42 PMbezrukov
08/03/2020, 6:45 PMjenji
08/03/2020, 6:47 PM