mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-03 21:07:39 +03:00
Use async fn for Service::ready() and Service::shutdown() (#364)
This commit is contained in:
parent
c52db3fd10
commit
3b49828e5f
33 changed files with 147 additions and 190 deletions
|
@ -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"
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(dead_code)]
|
||||
use std::{cell::Cell, future::poll_fn, rc::Rc, task, task::Poll};
|
||||
|
||||
use ntex_util::task::LocalWaker;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue