目前,我们正在将c制造的API网关引擎转换为tokio,hyper,rustls of rust.
在分析hyper_rustls(tokio_rustls)提供的echo服务器示例时,有一部分我不理解并请求帮助.
https://github.com/rustls/hyper-rustls/blob/main/examples/server.rs
以下是我想到的流程:
然而,一旦收到请求,就会执行传递给make_service_fn的代码,并向客户机发送响应,并且会多次执行tokio::io::AsyncRead特性的poll_read函数.这已经运行了.
问:make_fn_服务代码具体什么时候运行,这是我可以控制的吗?
Q: When using hyper, it seems to store the body accumulating in memory. Therefore, if the body size is very large, I would like to work with such as downloading it to a separate file. Is there a way to directly control every time the body comes?
- 我可以使用hyper::body::HttpBody特性吗?