Are there established ways to convert various flav...
# coroutines
m
Are there established ways to convert various flavors of future (beyond
CompletionStage.asDeferred()
) into
Deferred
for use in
suspend
functions? If not, I can always adapt code from
asDeferred
, but if there’s something supported out there, might as well use it
g
There are a bunch of coroutines adapters for different kinds of futures/promises. I don’t see any problem to convert any future to Deferred or, even better to just suspend function:
yourFuture.await()
Unfortunately this example doesn’t cover cancellation case
m
Hm, interesting. Perhaps adding
await()
as you suggest is the way to go.