1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-26 17:27:42 +02:00

remove pipeline from public api (#335)

This commit is contained in:
Rob Ede
2021-04-16 00:00:02 +01:00
committed by GitHub
parent 7a82288066
commit 47fba25d67
10 changed files with 85 additions and 35 deletions

View File

@ -9,15 +9,17 @@
//! Start typing. When you press enter the typed line will be echoed back. The server will log
//! the length of each line it echos and the total size of data sent when the connection is closed.
use std::sync::{
atomic::{AtomicUsize, Ordering},
Arc,
use std::{
env, io,
sync::{
atomic::{AtomicUsize, Ordering},
Arc,
},
};
use std::{env, io};
use actix_rt::net::TcpStream;
use actix_server::Server;
use actix_service::pipeline_factory;
use actix_service::{fn_service, ServiceFactoryExt as _};
use bytes::BytesMut;
use futures_util::future::ok;
use log::{error, info};
@ -25,7 +27,7 @@ use tokio::io::{AsyncReadExt, AsyncWriteExt};
#[actix_rt::main]
async fn main() -> io::Result<()> {
env::set_var("RUST_LOG", "actix=trace,basic=trace");
env::set_var("RUST_LOG", "info");
env_logger::init();
let count = Arc::new(AtomicUsize::new(0));
@ -41,7 +43,7 @@ async fn main() -> io::Result<()> {
let count = Arc::clone(&count);
let num2 = Arc::clone(&count);
pipeline_factory(move |mut stream: TcpStream| {
fn_service(move |mut stream: TcpStream| {
let count = Arc::clone(&count);
async move {