1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 15:07:42 +02:00

docs(web): unmention try_init_service

This commit is contained in:
Rob Ede
2024-08-18 14:33:28 +01:00
parent 4303dd8c37
commit 78ac5cf482
6 changed files with 11 additions and 14 deletions

View File

@ -22,16 +22,16 @@ async fn main() -> io::Result<()> {
.bind("streaming-error", ("127.0.0.1", 8080), || {
HttpService::build()
.finish(|req| async move {
info!("{:?}", req);
info!("{req:?}");
let res = Response::ok();
Ok::<_, Infallible>(res.set_body(BodyStream::new(stream! {
yield Ok(Bytes::from("123"));
yield Ok(Bytes::from("456"));
actix_rt::time::sleep(Duration::from_millis(1000)).await;
actix_rt::time::sleep(Duration::from_secs(1)).await;
yield Err(io::Error::new(io::ErrorKind::Other, ""));
yield Err(io::Error::new(io::ErrorKind::Other, "abc"));
})))
})
.tcp()