Skip to content

Commit d108785

Browse files
authored
Unify JoinHandle for all runtimes (#744)
1 parent 62ddfee commit d108785

File tree

34 files changed

+347
-301
lines changed

34 files changed

+347
-301
lines changed

.github/workflows/linux.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,43 +33,41 @@ jobs:
3333
uses: Swatinem/rust-cache@v2.8.2
3434

3535
- name: Run tests (neon-polling)
36-
timeout-minutes: 15
36+
timeout-minutes: 10
3737
run: |
3838
cargo nextest run --retries=3 --all --no-default-features --features="ntex/neon-polling,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws"
3939
4040
- name: Run doc tests (neon-polling)
41-
timeout-minutes: 15
41+
timeout-minutes: 10
4242
run: |
4343
cargo test --doc --all --no-default-features --features="ntex/neon-polling,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws"
4444
4545
- name: Run tests (neon-uring)
46-
timeout-minutes: 15
46+
timeout-minutes: 10
4747
run: |
4848
cargo nextest run --retries=3 --all --no-default-features --features="ntex/neon-uring,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws"
4949
5050
- name: Run doc tests (neon-uring)
51-
timeout-minutes: 15
51+
timeout-minutes: 10
5252
run: |
5353
cargo test --doc --all --no-default-features --features="ntex/neon-uring,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws"
5454
5555
- name: Run tests (tokio)
56-
timeout-minutes: 15
56+
timeout-minutes: 10
5757
run: |
5858
cargo nextest run --retries=3 --all --no-default-features --features="ntex/tokio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws"
5959
6060
- name: Run doc tests (tokio)
61-
timeout-minutes: 15
61+
timeout-minutes: 10
6262
run: |
6363
cargo test --doc --all --no-default-features --features="ntex/tokio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws"
6464
6565
- name: Run tests (compio)
66-
timeout-minutes: 15
67-
if: matrix.version != '1.86.0'
66+
timeout-minutes: 10
6867
run: |
6968
cargo nextest run --retries=3 --all --no-default-features --features="ntex/compio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws"
7069
7170
- name: Run doc tests (compio)
72-
timeout-minutes: 15
73-
if: matrix.version != '1.86.0'
71+
timeout-minutes: 10
7472
run: |
7573
cargo test --doc --all --no-default-features --features="ntex/compio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws"

.github/workflows/osx.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ jobs:
3232
uses: Swatinem/rust-cache@v2.8.2
3333

3434
- name: Run tests (neon)
35-
timeout-minutes: 15
35+
timeout-minutes: 10
3636
run: cargo nextest run --retries=3 --all --no-default-features --no-fail-fast --features="ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws"
3737

3838
- name: Run tests (tokio)
39-
timeout-minutes: 15
39+
timeout-minutes: 10
4040
run: cargo nextest run --retries=3 --all --no-default-features --no-fail-fast --features="ntex/tokio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws"
4141

4242
- name: Run tests (compio)
43-
timeout-minutes: 15
43+
timeout-minutes: 10
4444
run: cargo nextest run --retries=3 --all --no-default-features --features="ntex/compio,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws"

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ ntex-dispatcher = "3.0.0"
5959
ntex-net = "3.6.1"
6060
ntex-http = "1.0.0"
6161
ntex-router = "1.0.0"
62-
ntex-rt = "3.6.0"
62+
ntex-rt = "3.7.0"
6363
ntex-server = "3.6.0"
6464
ntex-service = "4.0.0"
6565
ntex-tls = "3.2.0"

ntex-bytes/tests/test_bytes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(clippy::op_ref, clippy::let_underscore_future)]
1+
#![allow(clippy::op_ref)]
22
use std::{borrow::Borrow, borrow::BorrowMut};
33

44
use ntex_bytes::info::Kind;

ntex-io/src/filterptr.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ impl FilterPtr {
3232

3333
pub(crate) fn set<F: Filter>(&self, filter: F) {
3434
let filter = Box::new(filter);
35-
let filter_ref = {
36-
let f: &dyn Filter = filter.as_ref();
37-
f as *const dyn Filter
38-
};
35+
let filter_ref = ptr::from_ref::<dyn Filter>(filter.as_ref());
3936
*self.as_mut() = Repr::Filter(Box::into_raw(filter).cast(), filter_ref);
4037
}
4138

@@ -91,10 +88,7 @@ impl FilterPtr {
9188
let repr = match self.as_ref() {
9289
Repr::Filter(..) => {
9390
let filter = Box::new(Layer::new(new, *self.take_filter::<F>()));
94-
let filter_ref = {
95-
let f: &dyn Filter = filter.as_ref();
96-
f as *const dyn Filter
97-
};
91+
let filter_ref = ptr::from_ref::<dyn Filter>(filter.as_ref());
9892
Repr::Filter(Box::into_raw(filter).cast(), filter_ref)
9993
}
10094
Repr::Sealed(..) => Repr::Sealed(Box::new(Layer::new(new, self.take_sealed()))),
@@ -108,10 +102,7 @@ impl FilterPtr {
108102
R: Filter,
109103
{
110104
let filter = Box::new(f(*self.take_filter::<F>()));
111-
let filter_ref = {
112-
let f: &dyn Filter = filter.as_ref();
113-
f as *const dyn Filter
114-
};
105+
let filter_ref = ptr::from_ref::<dyn Filter>(filter.as_ref());
115106
*self.as_mut() = Repr::Filter(Box::into_raw(filter).cast(), filter_ref);
116107
}
117108

ntex-io/src/timer.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ pub(crate) fn register(timeout: Seconds, io: &IoRef) -> TimerHandle {
129129
if !timer.running.get() {
130130
timer.running.set(true);
131131

132-
#[allow(clippy::let_underscore_future)]
133-
let _ = spawn(async move {
132+
spawn(async move {
134133
let guard = TimerGuard;
135134
loop {
136135
sleep(SEC).await;

ntex-rt/CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changes
22

3+
## [3.7.0] - 2026-02-04
4+
5+
* Unify JoinHandle for all runtimes
6+
7+
## [3.6.0] - 2026-02-02
8+
9+
* Update compio to 0.18
10+
311
## [3.5.0] - 2026-02-01
412

513
* Update compio to 0.18

ntex-rt/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ntex-rt"
3-
version = "3.6.0"
3+
version = "3.7.0"
44
authors = ["ntex contributors <team@ntex.rs>"]
55
description = "ntex runtime"
66
keywords = ["network", "framework", "async", "futures"]

ntex-rt/src/arbiter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl Arbiter {
122122

123123
config.block_on(async move {
124124
// start arbiter controller
125-
let _ = crate::spawn(
125+
crate::spawn(
126126
ArbiterController {
127127
stop: Some(stop),
128128
rx: arb_rx,
@@ -343,7 +343,7 @@ impl ArbiterController {
343343
break;
344344
}
345345
Ok(ArbiterCommand::Execute(fut)) => {
346-
let _ = crate::spawn(fut);
346+
crate::spawn(fut);
347347
}
348348
Ok(ArbiterCommand::ExecuteFn(f)) => {
349349
f.call_box();

ntex-rt/src/builder.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ impl SystemRunner {
194194
config.block_on(async move {
195195
f()?;
196196

197-
let _ = crate::spawn(support.run());
198-
let _ = crate::spawn(controller.run());
197+
crate::spawn(support.run());
198+
crate::spawn(controller.run());
199199
match stop.await {
200200
Ok(code) => {
201201
if code != 0 {
@@ -223,8 +223,8 @@ impl SystemRunner {
223223
} = self;
224224

225225
config.block_on(async move {
226-
let _ = crate::spawn(support.run());
227-
let _ = crate::spawn(controller.run());
226+
crate::spawn(support.run());
227+
crate::spawn(controller.run());
228228
fut.await
229229
})
230230
}
@@ -245,8 +245,8 @@ impl SystemRunner {
245245
// run loop
246246
tok_io::task::LocalSet::new()
247247
.run_until(async move {
248-
let _ = crate::spawn(support.run());
249-
let _ = crate::spawn(controller.run());
248+
crate::spawn(support.run());
249+
crate::spawn(controller.run());
250250
fut.await
251251
})
252252
.await

0 commit comments

Comments
 (0)