mirror of
https://github.com/fafhrd91/actix-web
synced 2025-01-18 22:01:50 +01:00
http: Minimize futures
dependencies
This commit is contained in:
parent
9bd6407730
commit
292af145cb
@ -56,9 +56,9 @@ copyless = "0.1.4"
|
|||||||
derive_more = "0.99.2"
|
derive_more = "0.99.2"
|
||||||
either = "1.5.3"
|
either = "1.5.3"
|
||||||
encoding_rs = "0.8"
|
encoding_rs = "0.8"
|
||||||
futures-core = "0.3.1"
|
futures-channel = { version = "0.3.5", default-features = false }
|
||||||
futures-util = "0.3.1"
|
futures-core = { version = "0.3.5", default-features = false }
|
||||||
futures-channel = "0.3.1"
|
futures-util = { version = "0.3.5", default-features = false }
|
||||||
fxhash = "0.2.1"
|
fxhash = "0.2.1"
|
||||||
h2 = "0.2.1"
|
h2 = "0.2.1"
|
||||||
http = "0.2.0"
|
http = "0.2.0"
|
||||||
@ -88,11 +88,10 @@ flate2 = { version = "1.0.13", optional = true }
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
actix-server = "1.0.1"
|
actix-server = "1.0.1"
|
||||||
actix-connect = { version = "2.0.0-alpha.2", features=["openssl"] }
|
actix-connect = { version = "2.0.0-alpha.2", features = ["openssl"] }
|
||||||
actix-http-test = { version = "1.0.0", features=["openssl"] }
|
actix-http-test = { version = "1.0.0", features = ["openssl"] }
|
||||||
actix-tls = { version = "2.0.0-alpha.1", features=["openssl"] }
|
actix-tls = { version = "2.0.0-alpha.1", features = ["openssl"] }
|
||||||
criterion = "0.3"
|
criterion = "0.3"
|
||||||
futures = "0.3.1"
|
|
||||||
env_logger = "0.7"
|
env_logger = "0.7"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
open-ssl = { version="0.10", package = "openssl" }
|
open-ssl = { version="0.10", package = "openssl" }
|
||||||
|
@ -3,7 +3,7 @@ use std::{env, io};
|
|||||||
use actix_http::{Error, HttpService, Request, Response};
|
use actix_http::{Error, HttpService, Request, Response};
|
||||||
use actix_server::Server;
|
use actix_server::Server;
|
||||||
use bytes::BytesMut;
|
use bytes::BytesMut;
|
||||||
use futures::StreamExt;
|
use futures_util::StreamExt;
|
||||||
use http::header::HeaderValue;
|
use http::header::HeaderValue;
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ use actix_http::http::HeaderValue;
|
|||||||
use actix_http::{Error, HttpService, Request, Response};
|
use actix_http::{Error, HttpService, Request, Response};
|
||||||
use actix_server::Server;
|
use actix_server::Server;
|
||||||
use bytes::BytesMut;
|
use bytes::BytesMut;
|
||||||
use futures::StreamExt;
|
use futures_util::StreamExt;
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|
||||||
async fn handle_request(mut req: Request) -> Result<Response, Error> {
|
async fn handle_request(mut req: Request) -> Result<Response, Error> {
|
||||||
|
@ -2,7 +2,7 @@ use std::{env, io};
|
|||||||
|
|
||||||
use actix_http::{HttpService, Response};
|
use actix_http::{HttpService, Response};
|
||||||
use actix_server::Server;
|
use actix_server::Server;
|
||||||
use futures::future;
|
use futures_util::future;
|
||||||
use http::header::HeaderValue;
|
use http::header::HeaderValue;
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|
||||||
|
@ -482,7 +482,7 @@ where
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use futures::stream;
|
use futures_util::stream;
|
||||||
use futures_util::future::poll_fn;
|
use futures_util::future::poll_fn;
|
||||||
use futures_util::pin_mut;
|
use futures_util::pin_mut;
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
|
use std::future::Future;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::task::{Context, Poll};
|
use std::task::{Context, Poll};
|
||||||
use std::{fmt, io, mem, time};
|
use std::{fmt, io, mem, time};
|
||||||
|
|
||||||
use actix_codec::{AsyncRead, AsyncWrite, Framed};
|
use actix_codec::{AsyncRead, AsyncWrite, Framed};
|
||||||
use bytes::{Buf, Bytes};
|
use bytes::{Buf, Bytes};
|
||||||
use futures_util::future::{err, Either, Future, FutureExt, LocalBoxFuture, Ready};
|
use futures_util::future::{err, Either, FutureExt, LocalBoxFuture, Ready};
|
||||||
use h2::client::SendRequest;
|
use h2::client::SendRequest;
|
||||||
use pin_project::{pin_project, project};
|
use pin_project::{pin_project, project};
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use actix_service::ServiceFactory;
|
use actix_service::ServiceFactory;
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use futures::future::{self, ok};
|
use futures_util::future::{self, ok};
|
||||||
|
|
||||||
use actix_http::{http, HttpService, Request, Response};
|
use actix_http::{http, HttpService, Request, Response};
|
||||||
use actix_http_test::test_server;
|
use actix_http_test::test_server;
|
||||||
|
@ -5,8 +5,8 @@ use actix_http_test::test_server;
|
|||||||
use actix_service::{fn_service, ServiceFactory};
|
use actix_service::{fn_service, ServiceFactory};
|
||||||
|
|
||||||
use bytes::{Bytes, BytesMut};
|
use bytes::{Bytes, BytesMut};
|
||||||
use futures::future::{err, ok, ready};
|
use futures_util::future::{err, ok, ready};
|
||||||
use futures::stream::{once, Stream, StreamExt};
|
use futures_util::stream::{once, Stream, StreamExt};
|
||||||
use open_ssl::ssl::{AlpnError, SslAcceptor, SslFiletype, SslMethod};
|
use open_ssl::ssl::{AlpnError, SslAcceptor, SslFiletype, SslMethod};
|
||||||
|
|
||||||
use actix_http::error::{ErrorBadRequest, PayloadError};
|
use actix_http::error::{ErrorBadRequest, PayloadError};
|
||||||
|
@ -7,8 +7,8 @@ use actix_http_test::test_server;
|
|||||||
use actix_service::{fn_factory_with_config, fn_service};
|
use actix_service::{fn_factory_with_config, fn_service};
|
||||||
|
|
||||||
use bytes::{Bytes, BytesMut};
|
use bytes::{Bytes, BytesMut};
|
||||||
use futures::future::{self, err, ok};
|
use futures_util::future::{self, err, ok};
|
||||||
use futures::stream::{once, Stream, StreamExt};
|
use futures_util::stream::{once, Stream, StreamExt};
|
||||||
use rust_tls::{
|
use rust_tls::{
|
||||||
internal::pemfile::{certs, pkcs8_private_keys},
|
internal::pemfile::{certs, pkcs8_private_keys},
|
||||||
NoClientAuth, ServerConfig as RustlsServerConfig,
|
NoClientAuth, ServerConfig as RustlsServerConfig,
|
||||||
|
@ -6,8 +6,8 @@ use actix_http_test::test_server;
|
|||||||
use actix_rt::time::delay_for;
|
use actix_rt::time::delay_for;
|
||||||
use actix_service::fn_service;
|
use actix_service::fn_service;
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use futures::future::{self, err, ok, ready, FutureExt};
|
use futures_util::future::{self, err, ok, ready, FutureExt};
|
||||||
use futures::stream::{once, StreamExt};
|
use futures_util::stream::{once, StreamExt};
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
|
||||||
use actix_http::httpmessage::HttpMessage;
|
use actix_http::httpmessage::HttpMessage;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
use std::future::Future;
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
@ -9,9 +10,9 @@ use actix_http_test::test_server;
|
|||||||
use actix_service::{fn_factory, Service};
|
use actix_service::{fn_factory, Service};
|
||||||
use actix_utils::framed::Dispatcher;
|
use actix_utils::framed::Dispatcher;
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use futures::future;
|
use futures_util::future;
|
||||||
use futures::task::{Context, Poll};
|
use futures_util::task::{Context, Poll};
|
||||||
use futures::{Future, SinkExt, StreamExt};
|
use futures_util::{SinkExt, StreamExt};
|
||||||
|
|
||||||
struct WsService<T>(Arc<Mutex<(PhantomData<T>, Cell<bool>)>>);
|
struct WsService<T>(Arc<Mutex<(PhantomData<T>, Cell<bool>)>>);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user