https://kotlinlang.org logo
#coroutines
Title
# coroutines
j

JoeHegarty

05/17/2018, 5:57 AM
Thanks. So it seems the idiom is just to name the method with async on the end and return a future, I'm fine with that just want to conform to what other folks are doing.
CompletableFuture<Unit>
, it's a little awkward but it's not really any more awkward than `CompletableFuure<Void>`or if you use just
CompletableFuture
as a rawtype which is pretty nasty for other reasons (though arguably more readable). It's a shame Java doesn't have something equivalent to Job in the futures space.
a

araqnid

05/17/2018, 8:23 PM
I use
CompletableFuture<?>
to indicate a job whose actual result type isn’t useful, rather than carrying around a reference to
Void
. so that would work just as well for one returning
Unit