stream_request

Function stream_request 

Source
pub fn stream_request<F, Fut>(callback: F) -> Response
where F: FnOnce(Arc<ResponseWriter>) -> Fut + 'static + Send, Fut: Future<Output = Result<()>> + Send,
Expand description

Streams a response by executing a callback that writes to a ResponseWriter.

This function creates a channel and a ResponseWriter that writes to this channel. The callback is then executed in a separate Tokio task, allowing it to stream data back to the client as it becomes available.