JakeWharton/retrofit2-kotlin-coroutines-adapter

Allow suspend + Deferred

Closed this issue · 2 comments

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