Is it possible somehow with Kotlin coroutines to d...
# coroutines
r
Is it possible somehow with Kotlin coroutines to do a behaviour like: a request(r1) comes to server, this request is handled in a thread from thread pool, server does some work in that thread, after this server make a request to remote server, at this moment this thread should be returned to thread pool to handle another request(r2), after remote server returned a response, request(r1) should continue work from moment when was made a remote request
e
rrader: That's the primary use-case for coroutines (that is, that is exactly what they were designed for)
r
it is a bit hard to understand how it should be, I see something like https://gist.github.com/anonymous/00c645a313c854d784186fb0da85b829 can you supply some examples how to make that I described?
e
You need to write (or find) async http library first
Kotlin coroutines is a language feature (for library writers) not a framework