mirror of https://github.com/fafhrd91/actix-net
Compare commits
8 Commits
5bb3fbfbfd
...
bf67ec6b94
Author | SHA1 | Date |
---|---|---|
|
bf67ec6b94 | |
|
160fdc5efc | |
|
c856fcdcd5 | |
|
4ee45b24b5 | |
|
43f9da3c4e | |
|
d24e5b4e95 | |
|
0d45bf9b43 | |
|
192d0661e9 |
|
@ -2,7 +2,9 @@ version: "0.2"
|
|||
words:
|
||||
- actix
|
||||
- addrs
|
||||
- clippy
|
||||
- mptcp
|
||||
- MSRV
|
||||
- nonblocking
|
||||
- oneshot
|
||||
- rustup
|
||||
|
|
|
@ -59,12 +59,12 @@ jobs:
|
|||
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
|
||||
|
||||
- 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:
|
||||
toolchain: ${{ matrix.version }}
|
||||
|
||||
- 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:
|
||||
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
||||
|
||||
|
@ -116,12 +116,12 @@ jobs:
|
|||
- uses: actions/checkout@v5
|
||||
|
||||
- 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:
|
||||
toolchain: nightly
|
||||
|
||||
- name: Install cargo-hack & cargo-minimal-versions
|
||||
uses: taiki-e/install-action@v2.58.17
|
||||
uses: taiki-e/install-action@v2.58.21
|
||||
with:
|
||||
tool: cargo-hack,cargo-minimal-versions
|
||||
|
||||
|
|
|
@ -68,12 +68,12 @@ jobs:
|
|||
echo "RUSTFLAGS=-C target-feature=+crt-static" >> $GITHUB_ENV
|
||||
|
||||
- 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:
|
||||
toolchain: ${{ matrix.version.version }}
|
||||
|
||||
- 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:
|
||||
tool: just,cargo-hack,cargo-nextest,cargo-ci-cache-clean
|
||||
|
||||
|
@ -120,12 +120,12 @@ jobs:
|
|||
- uses: actions/checkout@v5
|
||||
|
||||
- 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:
|
||||
toolchain: nightly
|
||||
|
||||
- name: Install just
|
||||
uses: taiki-e/install-action@v2.58.17
|
||||
uses: taiki-e/install-action@v2.58.21
|
||||
with:
|
||||
tool: just
|
||||
|
||||
|
|
|
@ -18,12 +18,12 @@ jobs:
|
|||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.13.0
|
||||
uses: actions-rust-lang/setup-rust-toolchain@v1.14.0
|
||||
with:
|
||||
components: llvm-tools-preview
|
||||
|
||||
- name: Install cargo-llvm-cov
|
||||
uses: taiki-e/install-action@v2.58.17
|
||||
uses: taiki-e/install-action@v2.58.21
|
||||
with:
|
||||
tool: cargo-llvm-cov
|
||||
|
||||
|
@ -31,7 +31,7 @@ jobs:
|
|||
run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v5.4.3
|
||||
uses: codecov/codecov-action@v5.5.0
|
||||
with:
|
||||
files: codecov.json
|
||||
fail_ci_if_error: true
|
||||
|
|
|
@ -18,7 +18,7 @@ jobs:
|
|||
steps:
|
||||
- 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:
|
||||
toolchain: nightly
|
||||
components: rustfmt
|
||||
|
@ -35,7 +35,7 @@ jobs:
|
|||
steps:
|
||||
- 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 }
|
||||
|
||||
- uses: giraffate/clippy-action@v1.0.1
|
||||
|
@ -51,12 +51,12 @@ jobs:
|
|||
- uses: actions/checkout@v5
|
||||
|
||||
- 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:
|
||||
toolchain: ${{ vars.RUST_VERSION_EXTERNAL_TYPES }}
|
||||
|
||||
- name: Install just
|
||||
uses: taiki-e/install-action@v2.58.17
|
||||
uses: taiki-e/install-action@v2.58.21
|
||||
with:
|
||||
tool: just
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -17,7 +17,7 @@ members = [
|
|||
[workspace.package]
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
rust-version = "1.80"
|
||||
rust-version = "1.75"
|
||||
|
||||
[patch.crates-io]
|
||||
actix-codec = { path = "actix-codec" }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.80.
|
||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||
|
||||
## 0.5.2
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.80.
|
||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||
|
||||
## 0.2.4
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![allow(unused_imports)]
|
||||
|
||||
mod system {
|
||||
pub use actix_rt::System as MySystem;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.80.
|
||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||
|
||||
## 2.10.0
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ fn main() {
|
|||
.worker_threads(2)
|
||||
.enable_all()
|
||||
.build()
|
||||
.map(std::sync::Arc::new)
|
||||
.unwrap()
|
||||
})
|
||||
.block_on(async_main());
|
||||
|
|
|
@ -109,7 +109,7 @@ impl Arbiter {
|
|||
#[cfg(not(all(target_os = "linux", feature = "io-uring")))]
|
||||
pub fn with_tokio_rt<F>(runtime_factory: F) -> Arbiter
|
||||
where
|
||||
F: FnOnce() -> tokio::runtime::Runtime + Send + 'static,
|
||||
F: FnOnce() -> std::sync::Arc<tokio::runtime::Runtime> + Send + 'static,
|
||||
{
|
||||
let sys = System::current();
|
||||
let system_id = sys.id();
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use std::{future::Future, io};
|
||||
|
||||
use std::{sync::Arc, future::Future, io};
|
||||
use tokio::task::{JoinHandle, LocalSet};
|
||||
|
||||
/// A Tokio-based runtime proxy.
|
||||
|
@ -9,14 +8,14 @@ use tokio::task::{JoinHandle, LocalSet};
|
|||
#[derive(Debug)]
|
||||
pub struct Runtime {
|
||||
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()
|
||||
.enable_io()
|
||||
.enable_time()
|
||||
.build()
|
||||
.build().map(Arc::new)
|
||||
}
|
||||
|
||||
impl Runtime {
|
||||
|
@ -141,6 +140,15 @@ impl Runtime {
|
|||
|
||||
impl From<tokio::runtime::Runtime> for Runtime {
|
||||
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 {
|
||||
local: LocalSet::new(),
|
||||
rt,
|
||||
|
|
|
@ -5,9 +5,9 @@ use std::{
|
|||
io,
|
||||
pin::Pin,
|
||||
sync::atomic::{AtomicUsize, Ordering},
|
||||
sync::Arc,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
|
||||
use futures_core::ready;
|
||||
use tokio::sync::{mpsc, oneshot};
|
||||
|
||||
|
@ -48,7 +48,7 @@ impl System {
|
|||
/// [tokio-runtime]: tokio::runtime::Runtime
|
||||
pub fn with_tokio_rt<F>(runtime_factory: F) -> SystemRunner
|
||||
where
|
||||
F: FnOnce() -> tokio::runtime::Runtime,
|
||||
F: FnOnce() -> Arc<tokio::runtime::Runtime>,
|
||||
{
|
||||
let (stop_tx, stop_rx) = oneshot::channel();
|
||||
let (sys_tx, sys_rx) = mpsc::unbounded_channel();
|
||||
|
@ -87,7 +87,7 @@ impl System {
|
|||
#[doc(hidden)]
|
||||
pub fn with_tokio_rt<F>(_: F) -> SystemRunner
|
||||
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")
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ use std::{
|
|||
use actix_rt::{task::JoinError, Arbiter, System};
|
||||
#[cfg(not(feature = "io-uring"))]
|
||||
use {
|
||||
std::{sync::mpsc::channel, thread},
|
||||
std::{sync::Arc, sync::mpsc::channel, thread},
|
||||
tokio::sync::oneshot,
|
||||
};
|
||||
|
||||
|
@ -252,6 +252,7 @@ fn new_system_with_tokio() {
|
|||
.on_thread_start(|| {})
|
||||
.on_thread_stop(|| {})
|
||||
.build()
|
||||
.map(Arc::new)
|
||||
.unwrap()
|
||||
})
|
||||
.block_on(async {
|
||||
|
@ -284,6 +285,7 @@ fn new_arbiter_with_tokio() {
|
|||
tokio::runtime::Builder::new_current_thread()
|
||||
.enable_all()
|
||||
.build()
|
||||
.map(Arc::new)
|
||||
.unwrap()
|
||||
});
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
## 2.6.0
|
||||
|
||||
- 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
|
||||
|
||||
|
|
|
@ -425,6 +425,7 @@ impl ServerWorker {
|
|||
.enable_all()
|
||||
.max_blocking_threads(config.max_blocking_threads)
|
||||
.build()
|
||||
.map(Arc::new)
|
||||
.unwrap()
|
||||
})
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.80.
|
||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||
|
||||
## 2.0.3
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.80.
|
||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||
|
||||
## 3.4.0
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.80.
|
||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||
|
||||
## 0.1.0
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.80.
|
||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||
|
||||
## 3.0.1
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.80.
|
||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||
|
||||
## 1.4.0
|
||||
|
||||
|
|
2
justfile
2
justfile
|
@ -23,6 +23,8 @@ fmt:
|
|||
# Downgrade dependencies necessary to run MSRV checks/tests.
|
||||
[private]
|
||||
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=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
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.80.
|
||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||
|
||||
## 0.1.5
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Minimum supported Rust version (MSRV) is now 1.80.
|
||||
- Minimum supported Rust version (MSRV) is now 1.75.
|
||||
|
||||
## 0.1.4
|
||||
|
||||
|
|
Loading…
Reference in New Issue