Currently with_chunked_body writes the entire body to a buffer.
This makes it impossible to test how servers stream the body: I don't control timing between chunks. I can't make an infinitely-long stream to test when the server will refuse to read it.
IMHO the chunked stream should spawn the callback on a thread, and use tokio's channel to send bytes to the body, as they're written.
@kornelski I agree. I think this regression was introduced with the tokio rewrite. not sure when I'll be able to tackle this but PRs are welcome as always :smile_cat:
Currently
with_chunked_body
writes the entire body to a buffer.This makes it impossible to test how servers stream the body: I don't control timing between chunks. I can't make an infinitely-long stream to test when the server will refuse to read it.
IMHO the chunked stream should spawn the callback on a thread, and use tokio's channel to send bytes to the body, as they're written.