Skip to content

Commit

Permalink
Use ntex-2.0 for tests (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 authored May 28, 2024
1 parent 89efb8d commit 495e5f4
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
11 changes: 5 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ default = []
unstable = []

[dependencies]
ntex-net = "2.0"
ntex-io = "2.0"
ntex-net = "2"
ntex-io = "2"
ntex-http = "0.1"
ntex-bytes = "0.1"
ntex-codec = "0.6"
ntex-service = "3.0"
ntex-util = "2.0"
ntex-rt = "0.4"
ntex-service = "3"
ntex-util = "2"

bitflags = "2"
fxhash = "0.2"
Expand All @@ -47,7 +46,7 @@ walkdir = "2.3.2"
serde = "1.0"
serde_json = "1.0"

ntex = { version = "1", features = ["openssl", "tokio"] }
ntex = { version = "2", features = ["openssl", "tokio"] }
ntex-tls = { version = "2", features = ["openssl"] }
ntex-net = { version = "2", features = ["tokio"] }
openssl = "0.10"
Expand Down
2 changes: 1 addition & 1 deletion src/client/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl Client {
let (tx, rx) = oneshot::channel();
let inner = self.inner.clone();
let waiters = self.waiters.clone();
let _ = ntex_rt::spawn(async move {
let _ = ntex_util::spawn(async move {
let res = match timeout_checked(inner.conn_timeout, (*inner.connector)()).await
{
Ok(Ok(io)) => {
Expand Down
2 changes: 1 addition & 1 deletion src/client/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl SimpleClient {
disp,
&con.config().dispatcher_config,
);
let _ = ntex_rt::spawn(async move {
let _ = ntex_util::spawn(async move {
let _ = fut.await;
});

Expand Down
4 changes: 2 additions & 2 deletions src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use std::{collections::VecDeque, time::Instant};
use ntex_bytes::{ByteString, Bytes};
use ntex_http::{HeaderMap, Method};
use ntex_io::IoRef;
use ntex_rt::spawn;
use ntex_util::{channel::pool, future::Either, time, time::now, time::sleep, HashMap, HashSet};
use ntex_util::time::{self, now, sleep};
use ntex_util::{channel::pool, future::Either, spawn, HashMap, HashSet};

use crate::config::{Config, ConfigInner};
use crate::error::{ConnectionError, OperationError, StreamError, StreamErrorInner};
Expand Down
3 changes: 1 addition & 2 deletions src/dispatcher.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use std::{fmt, future::poll_fn, future::Future, rc::Rc, task::Poll};

use ntex_io::DispatchItem;
use ntex_rt::spawn;
use ntex_service::{Pipeline, Service, ServiceCtx};
use ntex_util::future::{join, join_all, Either};
use ntex_util::HashMap;
use ntex_util::{spawn, HashMap};

use crate::connection::{Connection, RecvHalfConnection};
use crate::control::{Control, ControlAck};
Expand Down
2 changes: 1 addition & 1 deletion tests/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async fn connect(addr: net::SocketAddr) -> IoBoxed {
.map_err(|e| log::error!("Cannot set alpn protocol: {:?}", e));

let addr = ntex::connect::Connect::new("localhost").set_addr(Some(addr));
openssl::Connector::new(builder.build())
openssl::SslConnector::new(builder.build())
.connect(addr)
.await
.unwrap()
Expand Down
2 changes: 1 addition & 1 deletion tests/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn start_server(io: IoTest) -> mpsc::Receiver<Message> {
io.remote_buffer_cap(1000000);

let (tx, rx) = mpsc::channel();
ntex_rt::spawn(async move {
ntex_util::spawn(async move {
let _ = server::Server::new(
Config::server(),
fn_service(|msg: Control<()>| async move {
Expand Down

0 comments on commit 495e5f4

Please sign in to comment.