Allow suspend + Deferred
Closed this issue · 2 comments
LouisCAD commented
I know suspend fun
support is in the works. I assume it'd allow to directly get the expected type, which is fine.
However, supporting suspend fun
in retrofit interfaces that return a Deferred<T>
would allow to make an async API call that can be cancelled, since the suspend
would pass the coroutineContext
that contains the cancellable Job
.
The use case is to make concurrent API calls, where one failure cancels the coroutine, and automatically cancels the other API calls.
Related to #7
vadymhimself commented
+1
JakeWharton commented
Won't fix.