Use async fn for Service::ready() and Service::shutdown() (#364)

This commit is contained in:
Nikolay Kim 2024-05-28 19:26:08 +05:00 committed by GitHub
parent c52db3fd10
commit 3b49828e5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 147 additions and 190 deletions

View file

@ -40,7 +40,7 @@ tls_openssl = { version = "0.10", package = "openssl", optional = true }
tls_rust = { version = "0.23", package = "rustls", optional = true }
[dev-dependencies]
ntex = { version = "1", features = ["openssl", "rustls", "tokio"] }
ntex = { version = "2", features = ["openssl", "rustls", "tokio"] }
env_logger = "0.11"
rustls-pemfile = "2"
webpki-roots = "0.26"

View file

@ -16,7 +16,7 @@ async fn main() -> io::Result<()> {
.with_no_client_auth();
// rustls connector
let connector = connect::rustls::Connector::new(config.clone());
let connector = connect::rustls::TlsConnector::new(config.clone());
//let io = connector.connect("www.rust-lang.org:443").await.unwrap();
let io = connector.connect("127.0.0.1:8443").await.unwrap();

View file

@ -21,7 +21,7 @@ async fn main() -> io::Result<()> {
builder.set_verify(SslVerifyMode::NONE);
// openssl connector
let connector = connect::openssl::Connector::new(builder.build());
let connector = connect::openssl::SslConnector::new(builder.build());
let io = connector.connect("127.0.0.1:8443").await.unwrap();
println!("Connected to ssl server");

View file

@ -1,3 +1,4 @@
#![allow(dead_code)]
use std::{cell::Cell, future::poll_fn, rc::Rc, task, task::Poll};
use ntex_util::task::LocalWaker;