Description
We've gotten this question a few times. We should get an FAQ into the docs, and this should be in it.
For posterity, here's my answer on gitter:
the client needs to know when the response body has been fully read, so it can release the connection.
In that signature, it knows when the Task in that callback function completes.
Where you're running into trouble is that it releases the connection once the Task[InputStream] is run, and that InputStream hasn't read all the bytes yet.
I have only compiled this in my head, but io.toInputStream(client.streaming(request)(_.body))would get you an InputStream.
.streaming returns a Process instead of a Task. Then the burden falls on you to make sure that process runs to completion, or else the connection can only be reclaimed by garbage collection.
> Then when you adapt it to an InputStream, it becomes your responsibility to close it.