I am coming from the Node.js world but I'm looking for something with low latency, type-safety etc.
For my use-case I want to pipe a request body into a file (upload). Is this possible in Warp, without having the full contents in memory?
It is possible. You can get the request body as a stream via warp::body::stream(). And you can get an asynchronous-looking File with tokio-fs. Then you could combine Stream::for_each and tokio::io::write_all to write each chunk to the file. I'm on mobile, but I could later write up what that code looks like.
It does sound like very useful functionality to have directly in warp...
Most helpful comment
It is possible. You can get the request body as a stream via
warp::body::stream(). And you can get an asynchronous-lookingFilewith tokio-fs. Then you could combineStream::for_eachandtokio::io::write_allto write each chunk to the file. I'm on mobile, but I could later write up what that code looks like.It does sound like very useful functionality to have directly in warp...