Compare commits

...

8 Commits

Author SHA1 Message Date
Gerd Zellweger bf67ec6b94
Merge 192d0661e9 into 160fdc5efc 2025-08-27 22:43:26 +00:00
dependabot[bot] 160fdc5efc
build(deps): bump codecov/codecov-action from 5.4.3 to 5.5.0 (#721)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rob Ede <robjtede@icloud.com>
2025-08-26 16:39:21 +01:00
dependabot[bot] c856fcdcd5
build(deps): bump actions-rust-lang/setup-rust-toolchain (#720)
Bumps [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/actions-rust-lang/setup-rust-toolchain/releases)
- [Changelog](https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions-rust-lang/setup-rust-toolchain/compare/v1.13.0...v1.14.0)

---
updated-dependencies:
- dependency-name: actions-rust-lang/setup-rust-toolchain
  dependency-version: 1.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-26 10:24:07 +00:00
dependabot[bot] 4ee45b24b5
build(deps): bump taiki-e/install-action from 2.58.17 to 2.58.21 (#719)
Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.58.17 to 2.58.21.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/v2.58.17...v2.58.21)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.58.21
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-26 10:24:05 +00:00
dependabot[bot] 43f9da3c4e
build(deps): bump bitflags from 2.9.2 to 2.9.3 (#718)
Bumps [bitflags](https://github.com/bitflags/bitflags) from 2.9.2 to 2.9.3.
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.9.2...2.9.3)

---
updated-dependencies:
- dependency-name: bitflags
  dependency-version: 2.9.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-26 10:24:02 +00:00
dependabot[bot] d24e5b4e95
build(deps): bump serde_json from 1.0.142 to 1.0.143 (#717)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.142 to 1.0.143.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.142...v1.0.143)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-version: 1.0.143
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-26 10:24:01 +00:00
Rob Ede 0d45bf9b43
chore: revert msrv bump 2025-08-26 08:25:35 +01:00
Gerd Zellweger 192d0661e9 Change with_tokio_rt to accept Arc<Runtime>.
This allows to share tokio runtimes across different sub-systems
inside your application.

Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
2024-09-04 15:08:47 -07:00
26 changed files with 295 additions and 197 deletions

View File

@ -2,7 +2,9 @@ version: "0.2"
words: words:
- actix - actix
- addrs - addrs
- clippy
- mptcp - mptcp
- MSRV
- nonblocking - nonblocking
- oneshot - oneshot
- rustup - rustup

View File

@ -59,12 +59,12 @@ jobs:
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
- name: Install Rust (${{ matrix.version }}) - name: Install Rust (${{ matrix.version }})
uses: actions-rust-lang/setup-rust-toolchain@v1.13.0 uses: actions-rust-lang/setup-rust-toolchain@v1.14.0
with: with:
toolchain: ${{ matrix.version }} toolchain: ${{ matrix.version }}
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
uses: taiki-e/install-action@v2.58.17 uses: taiki-e/install-action@v2.58.21
with: with:
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
@ -116,12 +116,12 @@ jobs:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Install Rust (nightly) - name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1.13.0 uses: actions-rust-lang/setup-rust-toolchain@v1.14.0
with: with:
toolchain: nightly toolchain: nightly
- name: Install cargo-hack & cargo-minimal-versions - name: Install cargo-hack & cargo-minimal-versions
uses: taiki-e/install-action@v2.58.17 uses: taiki-e/install-action@v2.58.21
with: with:
tool: cargo-hack,cargo-minimal-versions tool: cargo-hack,cargo-minimal-versions

View File

@ -68,12 +68,12 @@ jobs:
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
- name: Install Rust (${{ matrix.version.name }}) - name: Install Rust (${{ matrix.version.name }})
uses: actions-rust-lang/setup-rust-toolchain@v1.13.0 uses: actions-rust-lang/setup-rust-toolchain@v1.14.0
with: with:
toolchain: ${{ matrix.version.version }} toolchain: ${{ matrix.version.version }}
- name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean - name: Install just, cargo-hack, cargo-nextest, cargo-ci-cache-clean
uses: taiki-e/install-action@v2.58.17 uses: taiki-e/install-action@v2.58.21
with: with:
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
@ -120,12 +120,12 @@ jobs:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Install Rust (nightly) - name: Install Rust (nightly)
uses: actions-rust-lang/setup-rust-toolchain@v1.13.0 uses: actions-rust-lang/setup-rust-toolchain@v1.14.0
with: with:
toolchain: nightly toolchain: nightly
- name: Install just - name: Install just
uses: taiki-e/install-action@v2.58.17 uses: taiki-e/install-action@v2.58.21
with: with:
tool: just tool: just

View File

@ -18,12 +18,12 @@ jobs:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Install Rust - name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.13.0 uses: actions-rust-lang/setup-rust-toolchain@v1.14.0
with: with:
components: llvm-tools-preview components: llvm-tools-preview
- name: Install cargo-llvm-cov - name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2.58.17 uses: taiki-e/install-action@v2.58.21
with: with:
tool: cargo-llvm-cov tool: cargo-llvm-cov
@ -31,7 +31,7 @@ jobs:
run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json
- name: Upload coverage to Codecov - name: Upload coverage to Codecov
uses: codecov/codecov-action@v5.4.3 uses: codecov/codecov-action@v5.5.0
with: with:
files: codecov.json files: codecov.json
fail_ci_if_error: true fail_ci_if_error: true

View File

@ -18,7 +18,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1.13.0 - uses: actions-rust-lang/setup-rust-toolchain@v1.14.0
with: with:
toolchain: nightly toolchain: nightly
components: rustfmt components: rustfmt
@ -35,7 +35,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1.13.0 - uses: actions-rust-lang/setup-rust-toolchain@v1.14.0
with: { components: clippy } with: { components: clippy }
- uses: giraffate/clippy-action@v1.0.1 - uses: giraffate/clippy-action@v1.0.1
@ -51,12 +51,12 @@ jobs:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Install Rust (${{ vars.RUST_VERSION_EXTERNAL_TYPES }}) - name: Install Rust (${{ vars.RUST_VERSION_EXTERNAL_TYPES }})
uses: actions-rust-lang/setup-rust-toolchain@v1.13.0 uses: actions-rust-lang/setup-rust-toolchain@v1.14.0
with: with:
toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }} toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }}
- name: Install just - name: Install just
uses: taiki-e/install-action@v2.58.17 uses: taiki-e/install-action@v2.58.21
with: with:
tool: just tool: just

400
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@ members = [
[workspace.package] [workspace.package]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
edition = "2021" edition = "2021"
rust-version = "1.80" rust-version = "1.75"
[patch.crates-io] [patch.crates-io]
actix-codec = { path = "actix-codec" } actix-codec = { path = "actix-codec" }

View File

@ -2,7 +2,7 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.80. - Minimum supported Rust version (MSRV) is now 1.75.
## 0.5.2 ## 0.5.2

View File

@ -2,7 +2,7 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.80. - Minimum supported Rust version (MSRV) is now 1.75.
## 0.2.4 ## 0.2.4

View File

@ -1,3 +1,5 @@
#![allow(unused_imports)]
mod system { mod system {
pub use actix_rt::System as MySystem; pub use actix_rt::System as MySystem;
} }

View File

@ -2,7 +2,7 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.80. - Minimum supported Rust version (MSRV) is now 1.75.
## 2.10.0 ## 2.10.0

View File

@ -10,6 +10,7 @@ fn main() {
.worker_threads(2) .worker_threads(2)
.enable_all() .enable_all()
.build() .build()
.map(std::sync::Arc::new)
.unwrap() .unwrap()
}) })
.block_on(async_main()); .block_on(async_main());

View File

@ -109,7 +109,7 @@ impl Arbiter {
#[cfg(not(all(target_os = "linux", feature = "io-uring")))] #[cfg(not(all(target_os = "linux", feature = "io-uring")))]
pub fn with_tokio_rt<F>(runtime_factory: F) -> Arbiter pub fn with_tokio_rt<F>(runtime_factory: F) -> Arbiter
where where
F: FnOnce() -> tokio::runtime::Runtime + Send + 'static, F: FnOnce() -> std::sync::Arc<tokio::runtime::Runtime> + Send + 'static,
{ {
let sys = System::current(); let sys = System::current();
let system_id = sys.id(); let system_id = sys.id();

View File

@ -1,5 +1,4 @@
use std::{future::Future, io}; use std::{sync::Arc, future::Future, io};
use tokio::task::{JoinHandle, LocalSet}; use tokio::task::{JoinHandle, LocalSet};
/// A Tokio-based runtime proxy. /// A Tokio-based runtime proxy.
@ -9,14 +8,14 @@ use tokio::task::{JoinHandle, LocalSet};
#[derive(Debug)] #[derive(Debug)]
pub struct Runtime { pub struct Runtime {
local: LocalSet, local: LocalSet,
rt: tokio::runtime::Runtime, rt: Arc<tokio::runtime::Runtime>,
} }
pub(crate) fn default_tokio_runtime() -> io::Result<tokio::runtime::Runtime> { pub(crate) fn default_tokio_runtime() -> io::Result<Arc<tokio::runtime::Runtime>> {
tokio::runtime::Builder::new_current_thread() tokio::runtime::Builder::new_current_thread()
.enable_io() .enable_io()
.enable_time() .enable_time()
.build() .build().map(Arc::new)
} }
impl Runtime { impl Runtime {
@ -141,6 +140,15 @@ impl Runtime {
impl From<tokio::runtime::Runtime> for Runtime { impl From<tokio::runtime::Runtime> for Runtime {
fn from(rt: tokio::runtime::Runtime) -> Self { fn from(rt: tokio::runtime::Runtime) -> Self {
Self {
local: LocalSet::new(),
rt: Arc::new(rt),
}
}
}
impl From<Arc<tokio::runtime::Runtime>> for Runtime {
fn from(rt: Arc<tokio::runtime::Runtime>) -> Self {
Self { Self {
local: LocalSet::new(), local: LocalSet::new(),
rt, rt,

View File

@ -5,9 +5,9 @@ use std::{
io, io,
pin::Pin, pin::Pin,
sync::atomic::{AtomicUsize, Ordering}, sync::atomic::{AtomicUsize, Ordering},
sync::Arc,
task::{Context, Poll}, task::{Context, Poll},
}; };
use futures_core::ready; use futures_core::ready;
use tokio::sync::{mpsc, oneshot}; use tokio::sync::{mpsc, oneshot};
@ -48,7 +48,7 @@ impl System {
/// [tokio-runtime]: tokio::runtime::Runtime /// [tokio-runtime]: tokio::runtime::Runtime
pub fn with_tokio_rt<F>(runtime_factory: F) -> SystemRunner pub fn with_tokio_rt<F>(runtime_factory: F) -> SystemRunner
where where
F: FnOnce() -> tokio::runtime::Runtime, F: FnOnce() -> Arc<tokio::runtime::Runtime>,
{ {
let (stop_tx, stop_rx) = oneshot::channel(); let (stop_tx, stop_rx) = oneshot::channel();
let (sys_tx, sys_rx) = mpsc::unbounded_channel(); let (sys_tx, sys_rx) = mpsc::unbounded_channel();
@ -87,7 +87,7 @@ impl System {
#[doc(hidden)] #[doc(hidden)]
pub fn with_tokio_rt<F>(_: F) -> SystemRunner pub fn with_tokio_rt<F>(_: F) -> SystemRunner
where where
F: FnOnce() -> tokio::runtime::Runtime, F: FnOnce() -> Arc<tokio::runtime::Runtime>,
{ {
unimplemented!("System::with_tokio_rt is not implemented for io-uring feature yet") unimplemented!("System::with_tokio_rt is not implemented for io-uring feature yet")
} }

View File

@ -8,7 +8,7 @@ use std::{
use actix_rt::{task::JoinError, Arbiter, System}; use actix_rt::{task::JoinError, Arbiter, System};
#[cfg(not(feature = "io-uring"))] #[cfg(not(feature = "io-uring"))]
use { use {
std::{sync::mpsc::channel, thread}, std::{sync::Arc, sync::mpsc::channel, thread},
tokio::sync::oneshot, tokio::sync::oneshot,
}; };
@ -252,6 +252,7 @@ fn new_system_with_tokio() {
.on_thread_start(|| {}) .on_thread_start(|| {})
.on_thread_stop(|| {}) .on_thread_stop(|| {})
.build() .build()
.map(Arc::new)
.unwrap() .unwrap()
}) })
.block_on(async { .block_on(async {
@ -284,6 +285,7 @@ fn new_arbiter_with_tokio() {
tokio::runtime::Builder::new_current_thread() tokio::runtime::Builder::new_current_thread()
.enable_all() .enable_all()
.build() .build()
.map(Arc::new)
.unwrap() .unwrap()
}); });

View File

@ -5,7 +5,7 @@
## 2.6.0 ## 2.6.0
- Add `ServerBuilder::shutdown_signal()` method. - Add `ServerBuilder::shutdown_signal()` method.
- Minimum supported Rust version (MSRV) is now 1.80. - Minimum supported Rust version (MSRV) is now 1.75.
## 2.5.1 ## 2.5.1

View File

@ -425,6 +425,7 @@ impl ServerWorker {
.enable_all() .enable_all()
.max_blocking_threads(config.max_blocking_threads) .max_blocking_threads(config.max_blocking_threads)
.build() .build()
.map(Arc::new)
.unwrap() .unwrap()
}) })
}; };

View File

@ -2,7 +2,7 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.80. - Minimum supported Rust version (MSRV) is now 1.75.
## 2.0.3 ## 2.0.3

View File

@ -2,7 +2,7 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.80. - Minimum supported Rust version (MSRV) is now 1.75.
## 3.4.0 ## 3.4.0

View File

@ -2,7 +2,7 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.80. - Minimum supported Rust version (MSRV) is now 1.75.
## 0.1.0 ## 0.1.0

View File

@ -2,7 +2,7 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.80. - Minimum supported Rust version (MSRV) is now 1.75.
## 3.0.1 ## 3.0.1

View File

@ -2,7 +2,7 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.80. - Minimum supported Rust version (MSRV) is now 1.75.
## 1.4.0 ## 1.4.0

View File

@ -23,6 +23,8 @@ fmt:
# Downgrade dependencies necessary to run MSRV checks/tests. # Downgrade dependencies necessary to run MSRV checks/tests.
[private] [private]
downgrade-for-msrv: downgrade-for-msrv:
cargo {{ toolchain }} update -p=rayon --precise=1.10.0 # next ver: 1.80.0
cargo {{ toolchain }} update -p=rayon-core --precise=1.12.1 # next ver: 1.80.0
cargo {{ toolchain }} update -p=native-tls --precise=0.2.13 # next ver: 1.80.0 cargo {{ toolchain }} update -p=native-tls --precise=0.2.13 # next ver: 1.80.0
cargo {{ toolchain }} update -p=idna_adapter --precise=1.2.0 # next ver: 1.82.0 cargo {{ toolchain }} update -p=idna_adapter --precise=1.2.0 # next ver: 1.82.0
cargo {{ toolchain }} update -p=litemap --precise=0.7.4 # next ver: 1.81.0 cargo {{ toolchain }} update -p=litemap --precise=0.7.4 # next ver: 1.81.0

View File

@ -2,7 +2,7 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.80. - Minimum supported Rust version (MSRV) is now 1.75.
## 0.1.5 ## 0.1.5

View File

@ -2,7 +2,7 @@
## Unreleased ## Unreleased
- Minimum supported Rust version (MSRV) is now 1.80. - Minimum supported Rust version (MSRV) is now 1.75.
## 0.1.4 ## 0.1.4