Any resources for implementing coroutines+ retrofi...
# coroutines
h
Any resources for implementing coroutines+ retrofit 2 especially when one wants to chain multiple calls
there are a few examples
Also there is Retrofit adapter that allows use Deferred as return type of Retrofit interface methods https://github.com/JakeWharton/retrofit2-kotlin-coroutines-adapter Nio examples there, but you just call
await()
Not sure what you mean about “chain multiple calls”. Just call multiple requests sequentially, one by one? This is default behaviour of coroutines:
Copy code
val user = api.loadUser().await()
val result = api.followUser(user..id).await()
.await()
will suspend until request result
h
Okay thank you will look at the links you have sent. I appreciate.
About chaining of requests, in your last answer you have already clarified it very well