JakeWharton/retrofit2-kotlin-coroutines-adapter

[ENHANCEMENT]ReceiveChannel or produce-consume pattern

Closed this issue · 1 comments

I'd like the style

interface MyService { 
  @GET("/user")
  fun getUser(): ReceiveChannel<Response<User>>
}

getUser().consume { user ->
   print(user.body)
}

Maybe it could be another alternative to the return value.

Since HTTP requests have a single return value I don't see any value in providing this over Deferred<T> and the use of await().