diff --git a/.github/workflows/cov.yml b/.github/workflows/cov.yml index a57edd23..7e9ed86b 100644 --- a/.github/workflows/cov.yml +++ b/.github/workflows/cov.yml @@ -36,7 +36,7 @@ jobs: run: cargo llvm-cov --no-report --all --no-default-features --features="ntex/default-rt,ntex/cookie,ntex/url,ntex/compress,ntex/openssl,ntex/rustls,ntex/ws,ntex/brotli" - name: Generate coverage report - run: cargo llvm-cov report --lcov --output-path lcov.info --ignore-filename-regex="ntex-compio|ntex-tokio|ntex-glommio|ntex-async-std" + run: cargo llvm-cov report --lcov --output-path lcov.info --ignore-filename-regex="ntex-compio|ntex-tokio|ntex-async-std" - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 diff --git a/Cargo.toml b/Cargo.toml index 7461076d..45d44daf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,6 @@ members = [ "ntex-async-std", "ntex-compio", - "ntex-glommio", "ntex-tokio", ] @@ -49,7 +48,6 @@ ntex-macros = { path = "ntex-macros" } ntex-util = { path = "ntex-util" } ntex-compio = { path = "ntex-compio" } -ntex-glommio = { path = "ntex-glommio" } ntex-tokio = { path = "ntex-tokio" } ntex-async-std = { path = "ntex-async-std" } diff --git a/ntex-glommio/CHANGES.md b/ntex-glommio/CHANGES.md deleted file mode 100644 index 30faefde..00000000 --- a/ntex-glommio/CHANGES.md +++ /dev/null @@ -1,57 +0,0 @@ -# Changes - -## [0.5.2] - 2024-09-xx - -* Update to glommio v0.9 - -## [0.4.0] - 2024-01-09 - -* Release - -## [0.4.0-b.0] - 2024-01-07 - -* Use "async fn" in trait for Service definition - -## [0.3.1] - 2023-11-22 - -* Replace async-oneshot with oneshot - -## [0.3.0] - 2023-06-22 - -* Release v0.3.0 - -## [0.3.0-beta.0] - 2023-06-16 - -* Migrate to ntex-service 1.2 - -## [0.2.4] - 2023-05-30 - -* Fix borrow mut panic #204 - -## [0.2.3] - 2023-04-11 - -* Chore upgrade glommio to 0.8 - -## [0.2.2] - 2023-01-26 - -* Update io api usage - -## [0.2.0] - 2023-01-04 - -* Release - -## [0.2.0-beta.0] - 2022-12-28 - -* Migrate to ntex-service 1.0 - -## [0.1.2] - 2022-02-20 - -* Upgrade to glommio 0.7 - -## [0.1.1] - 2022-01-30 - -* Update to ntex-io 0.1.7 - -## [0.1.0] - 2022-01-17 - -* Initial release diff --git a/ntex-glommio/Cargo.toml b/ntex-glommio/Cargo.toml deleted file mode 100644 index bb9ec0ed..00000000 --- a/ntex-glommio/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "ntex-glommio" -version = "0.5.2" -authors = ["ntex contributors "] -description = "glommio intergration for ntex framework" -keywords = ["network", "framework", "async", "futures"] -homepage = "https://ntex.rs" -repository = "https://github.com/ntex-rs/ntex.git" -documentation = "https://docs.rs/ntex-rt-glommio/" -categories = ["network-programming", "asynchronous"] -license = "MIT OR Apache-2.0" -edition = "2021" - -[lib] -name = "ntex_glommio" -path = "src/lib.rs" - -[dependencies] -ntex-bytes = "0.1" -ntex-io = "2.5" -ntex-util = "2.0" -futures-lite = "2.2" -log = "0.4" -oneshot = { version = "0.1", default-features = false, features = ["async"] } - -[target.'cfg(target_os = "linux")'.dependencies] -glommio = "0.9" diff --git a/ntex-glommio/LICENSE-APACHE b/ntex-glommio/LICENSE-APACHE deleted file mode 120000 index 965b606f..00000000 --- a/ntex-glommio/LICENSE-APACHE +++ /dev/null @@ -1 +0,0 @@ -../LICENSE-APACHE \ No newline at end of file diff --git a/ntex-glommio/LICENSE-MIT b/ntex-glommio/LICENSE-MIT deleted file mode 120000 index 76219eb7..00000000 --- a/ntex-glommio/LICENSE-MIT +++ /dev/null @@ -1 +0,0 @@ -../LICENSE-MIT \ No newline at end of file diff --git a/ntex-glommio/src/io.rs b/ntex-glommio/src/io.rs deleted file mode 100644 index 09fc0616..00000000 --- a/ntex-glommio/src/io.rs +++ /dev/null @@ -1,205 +0,0 @@ -use std::{any, future::poll_fn, io, pin::Pin, task::ready, task::Context, task::Poll}; - -use futures_lite::io::{AsyncRead, AsyncWrite}; -use ntex_bytes::{Buf, BufMut, BytesVec}; -use ntex_io::{types, Handle, IoStream, ReadContext, WriteContext, WriteContextBuf}; - -use crate::net_impl::{TcpStream, UnixStream}; - -impl IoStream for TcpStream { - fn start(self, read: ReadContext, write: WriteContext) -> Option> { - let mut rio = Read(self.clone()); - glommio::spawn_local(async move { read.handle(&mut rio).await }).detach(); - let mut wio = Write(self.clone()); - glommio::spawn_local(async move { write.handle(&mut wio).await }).detach(); - Some(Box::new(self)) - } -} - -impl IoStream for UnixStream { - fn start(self, read: ReadContext, write: WriteContext) -> Option> { - let mut rio = UnixRead(self.clone()); - glommio::spawn_local(async move { - read.handle(&mut rio).await; - }) - .detach(); - let mut wio = UnixWrite(self); - glommio::spawn_local(async move { write.handle(&mut wio).await }).detach(); - None - } -} - -impl Handle for TcpStream { - fn query(&self, id: any::TypeId) -> Option> { - if id == any::TypeId::of::() { - if let Ok(addr) = self.0.borrow().peer_addr() { - return Some(Box::new(types::PeerAddr(addr))); - } - } - None - } -} - -/// Read io task -struct Read(TcpStream); - -impl ntex_io::AsyncRead for Read { - async fn read(&mut self, mut buf: BytesVec) -> (BytesVec, io::Result) { - // read data from socket - let result = poll_fn(|cx| { - let mut io = self.0 .0.borrow_mut(); - poll_read_buf(Pin::new(&mut *io), cx, &mut buf) - }) - .await; - (buf, result) - } -} - -struct Write(TcpStream); - -impl ntex_io::AsyncWrite for Write { - #[inline] - async fn write(&mut self, buf: &mut WriteContextBuf) -> io::Result<()> { - poll_fn(|cx| { - if let Some(mut b) = buf.take() { - let result = flush_io(&mut *self.0 .0.borrow_mut(), &mut b, cx); - buf.set(b); - result - } else { - Poll::Ready(Ok(())) - } - }) - .await - } - - #[inline] - async fn flush(&mut self) -> io::Result<()> { - Ok(()) - } - - #[inline] - async fn shutdown(&mut self) -> io::Result<()> { - poll_fn(|cx| Pin::new(&mut *self.0 .0.borrow_mut()).poll_close(cx)).await - } -} - -struct UnixRead(UnixStream); - -impl ntex_io::AsyncRead for UnixRead { - async fn read(&mut self, mut buf: BytesVec) -> (BytesVec, io::Result) { - // read data from socket - let result = poll_fn(|cx| { - let mut io = self.0 .0.borrow_mut(); - poll_read_buf(Pin::new(&mut *io), cx, &mut buf) - }) - .await; - (buf, result) - } -} - -struct UnixWrite(UnixStream); - -impl ntex_io::AsyncWrite for UnixWrite { - #[inline] - async fn write(&mut self, buf: &mut WriteContextBuf) -> io::Result<()> { - poll_fn(|cx| { - if let Some(mut b) = buf.take() { - let result = flush_io(&mut *self.0 .0.borrow_mut(), &mut b, cx); - buf.set(b); - result - } else { - Poll::Ready(Ok(())) - } - }) - .await - } - - #[inline] - async fn flush(&mut self) -> io::Result<()> { - Ok(()) - } - - #[inline] - async fn shutdown(&mut self) -> io::Result<()> { - poll_fn(|cx| Pin::new(&mut *self.0 .0.borrow_mut()).poll_close(cx)).await - } -} - -/// Flush write buffer to underlying I/O stream. -pub(super) fn flush_io( - io: &mut T, - buf: &mut BytesVec, - cx: &mut Context<'_>, -) -> Poll> { - let len = buf.len(); - - if len != 0 { - // log::trace!("flushing framed transport: {:?}", buf.len()); - - let mut written = 0; - let result = loop { - break match Pin::new(&mut *io).poll_write(cx, &buf[written..]) { - Poll::Ready(Ok(n)) => { - if n == 0 { - log::trace!("Disconnected during flush, written {}", written); - Poll::Ready(Err(io::Error::new( - io::ErrorKind::WriteZero, - "failed to write frame to transport", - ))) - } else { - written += n; - if written == len { - buf.clear(); - Poll::Ready(Ok(())) - } else { - continue; - } - } - } - Poll::Pending => { - // remove written data - buf.advance(written); - Poll::Pending - } - Poll::Ready(Err(e)) => { - log::trace!("Error during flush: {}", e); - Poll::Ready(Err(e)) - } - }; - }; - // log::trace!("flushed {} bytes", written); - - // flush - if written > 0 { - match Pin::new(&mut *io).poll_flush(cx) { - Poll::Ready(Ok(_)) => result, - Poll::Pending => Poll::Pending, - Poll::Ready(Err(e)) => { - log::trace!("error during flush: {}", e); - Poll::Ready(Err(e)) - } - } - } else { - result - } - } else { - Poll::Ready(Ok(())) - } -} - -pub fn poll_read_buf( - io: Pin<&mut T>, - cx: &mut Context<'_>, - buf: &mut BytesVec, -) -> Poll> { - let dst = unsafe { &mut *(buf.chunk_mut() as *mut _ as *mut [u8]) }; - let n = ready!(io.poll_read(cx, dst))?; - - // Safety: This is guaranteed to be the number of initialized (and read) - // bytes due to the invariants provided by Read::poll_read() api - unsafe { - buf.advance_mut(n); - } - - Poll::Ready(Ok(n)) -} diff --git a/ntex-glommio/src/lib.rs b/ntex-glommio/src/lib.rs deleted file mode 100644 index 8c8885b5..00000000 --- a/ntex-glommio/src/lib.rs +++ /dev/null @@ -1,90 +0,0 @@ -#[cfg(target_os = "linux")] -mod io; -#[cfg(target_os = "linux")] -mod signals; - -#[cfg(target_os = "linux")] -pub use self::signals::{signal, Signal}; - -#[cfg(target_os = "linux")] -mod net_impl { - use std::os::unix::io::{FromRawFd, IntoRawFd}; - use std::{cell::RefCell, io::Result, net, net::SocketAddr, rc::Rc}; - - use ntex_bytes::PoolRef; - use ntex_io::Io; - - #[derive(Clone)] - pub(crate) struct TcpStream(pub(crate) Rc>); - - impl TcpStream { - fn new(io: glommio::net::TcpStream) -> Self { - Self(Rc::new(RefCell::new(io))) - } - } - - #[derive(Clone)] - pub(crate) struct UnixStream(pub(crate) Rc>); - - impl UnixStream { - fn new(io: glommio::net::UnixStream) -> Self { - Self(Rc::new(RefCell::new(io))) - } - } - - /// Opens a TCP connection to a remote host. - pub async fn tcp_connect(addr: SocketAddr) -> Result { - let sock = glommio::net::TcpStream::connect(addr).await?; - sock.set_nodelay(true)?; - Ok(Io::new(TcpStream::new(sock))) - } - - /// Opens a TCP connection to a remote host and use specified memory pool. - pub async fn tcp_connect_in(addr: SocketAddr, pool: PoolRef) -> Result { - let sock = glommio::net::TcpStream::connect(addr).await?; - sock.set_nodelay(true)?; - Ok(Io::with_memory_pool(TcpStream::new(sock), pool)) - } - - /// Opens a unix stream connection. - pub async fn unix_connect

(addr: P) -> Result - where - P: AsRef, - { - let sock = glommio::net::UnixStream::connect(addr).await?; - Ok(Io::new(UnixStream::new(sock))) - } - - /// Opens a unix stream connection and specified memory pool. - pub async fn unix_connect_in

(addr: P, pool: PoolRef) -> Result - where - P: AsRef, - { - let sock = glommio::net::UnixStream::connect(addr).await?; - Ok(Io::with_memory_pool(UnixStream::new(sock), pool)) - } - - /// Convert std TcpStream to glommio's TcpStream - pub fn from_tcp_stream(stream: net::TcpStream) -> Result { - stream.set_nonblocking(true)?; - stream.set_nodelay(true)?; - unsafe { - Ok(Io::new(TcpStream::new( - glommio::net::TcpStream::from_raw_fd(stream.into_raw_fd()), - ))) - } - } - - /// Convert std UnixStream to glommio's UnixStream - pub fn from_unix_stream(stream: std::os::unix::net::UnixStream) -> Result { - stream.set_nonblocking(true)?; - unsafe { - Ok(Io::new(UnixStream::new( - glommio::net::UnixStream::from_raw_fd(stream.into_raw_fd()), - ))) - } - } -} - -#[cfg(target_os = "linux")] -pub use self::net_impl::*; diff --git a/ntex-glommio/src/signals.rs b/ntex-glommio/src/signals.rs deleted file mode 100644 index 366ace9c..00000000 --- a/ntex-glommio/src/signals.rs +++ /dev/null @@ -1,50 +0,0 @@ -use std::{cell::RefCell, future::Future, pin::Pin, rc::Rc, task::Context, task::Poll}; - -thread_local! { - static SRUN: RefCell = const { RefCell::new(false) }; - static SHANDLERS: Rc>>> = Default::default(); -} - -/// Different types of process signals -#[derive(PartialEq, Clone, Copy, Debug)] -pub enum Signal { - /// SIGHUP - Hup, - /// SIGINT - Int, - /// SIGTERM - Term, - /// SIGQUIT - Quit, -} - -/// Register signal handler. -/// -/// Signals are handled by oneshots, you have to re-register -/// after each signal. -pub fn signal() -> Option> { - if !SRUN.with(|v| *v.borrow()) { - glommio::spawn_local(Signals::new()).detach(); - } - SHANDLERS.with(|handlers| { - let (tx, rx) = oneshot::channel(); - handlers.borrow_mut().push(tx); - Some(rx) - }) -} - -struct Signals {} - -impl Signals { - pub(super) fn new() -> Signals { - Self {} - } -} - -impl Future for Signals { - type Output = (); - - fn poll(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll { - Poll::Ready(()) - } -} diff --git a/ntex-net/CHANGES.md b/ntex-net/CHANGES.md index 682d9160..8afe3ad4 100644 --- a/ntex-net/CHANGES.md +++ b/ntex-net/CHANGES.md @@ -1,5 +1,11 @@ # Changes +## [2.5.0] - 2025-03-10 + +* Add ntex-runtime support + +* Drop glommio support + ## [2.4.0] - 2024-09-25 * Update to glommio v0.9 diff --git a/ntex-net/Cargo.toml b/ntex-net/Cargo.toml index 112d84bc..266d0a84 100644 --- a/ntex-net/Cargo.toml +++ b/ntex-net/Cargo.toml @@ -24,9 +24,6 @@ tokio = ["ntex-rt/tokio", "ntex-tokio"] # compio runtime compio = ["ntex-rt/compio", "ntex-compio"] -# glommio runtime -glommio = ["ntex-rt/glommio", "ntex-glommio"] - # async-std runtime async-std = ["ntex-rt/async-std", "ntex-async-std"] @@ -43,7 +40,6 @@ ntex-util = "2.5" ntex-tokio = { version = "0.5.3", optional = true } ntex-compio = { version = "0.2.4", optional = true } -ntex-glommio = { version = "0.5.2", optional = true } ntex-async-std = { version = "0.5.1", optional = true } ntex-runtime = { version = "0.1.0", optional = true } diff --git a/ntex-net/src/compat.rs b/ntex-net/src/compat.rs index 98fa73cb..0092c172 100644 --- a/ntex-net/src/compat.rs +++ b/ntex-net/src/compat.rs @@ -10,8 +10,7 @@ pub use ntex_tokio::{from_unix_stream, unix_connect, unix_connect_in}; feature = "default-rt", not(feature = "tokio"), not(feature = "async-std"), - not(feature = "compio"), - not(feature = "glommio") + not(feature = "compio") ))] pub use crate::rt::{ from_tcp_stream, from_unix_stream, tcp_connect, tcp_connect_in, unix_connect, @@ -22,8 +21,7 @@ pub use crate::rt::{ feature = "compio", not(feature = "tokio"), not(feature = "async-std"), - not(feature = "default-rt"), - not(feature = "glommio") + not(feature = "default-rt") ))] pub use ntex_compio::{from_tcp_stream, tcp_connect, tcp_connect_in}; @@ -32,8 +30,7 @@ pub use ntex_compio::{from_tcp_stream, tcp_connect, tcp_connect_in}; feature = "compio", not(feature = "tokio"), not(feature = "async-std"), - not(feature = "default-rt"), - not(feature = "glommio") + not(feature = "default-rt") ))] pub use ntex_compio::{from_unix_stream, unix_connect, unix_connect_in}; @@ -41,8 +38,7 @@ pub use ntex_compio::{from_unix_stream, unix_connect, unix_connect_in}; feature = "async-std", not(feature = "tokio"), not(feature = "compio"), - not(feature = "default-rt"), - not(feature = "glommio") + not(feature = "default-rt") ))] pub use ntex_async_std::{from_tcp_stream, tcp_connect, tcp_connect_in}; @@ -51,36 +47,15 @@ pub use ntex_async_std::{from_tcp_stream, tcp_connect, tcp_connect_in}; feature = "async-std", not(feature = "tokio"), not(feature = "compio"), - not(feature = "default-rt"), - not(feature = "glommio") + not(feature = "default-rt") ))] pub use ntex_async_std::{from_unix_stream, unix_connect, unix_connect_in}; -#[cfg(all( - feature = "glommio", - not(feature = "tokio"), - not(feature = "compio"), - not(feature = "default-rt"), - not(feature = "async-std") -))] -pub use ntex_glommio::{from_tcp_stream, tcp_connect, tcp_connect_in}; - -#[cfg(all( - unix, - feature = "glommio", - not(feature = "tokio"), - not(feature = "compio"), - not(feature = "default-rt"), - not(feature = "async-std") -))] -pub use ntex_glommio::{from_unix_stream, unix_connect, unix_connect_in}; - #[cfg(all( not(feature = "tokio"), not(feature = "compio"), not(feature = "async-std"), - not(feature = "default-rt"), - not(feature = "glommio") + not(feature = "default-rt") ))] mod no_rt { use ntex_io::Io; @@ -150,7 +125,6 @@ mod no_rt { not(feature = "tokio"), not(feature = "compio"), not(feature = "async-std"), - not(feature = "default-rt"), - not(feature = "glommio") + not(feature = "default-rt") ))] pub use no_rt::*; diff --git a/ntex-net/src/lib.rs b/ntex-net/src/lib.rs index d03d9b35..39199f4b 100644 --- a/ntex-net/src/lib.rs +++ b/ntex-net/src/lib.rs @@ -13,7 +13,6 @@ pub use self::compat::*; feature = "default-rt", not(feature = "tokio"), not(feature = "async-std"), - not(feature = "compio"), - not(feature = "glommio") + not(feature = "compio") ))] mod rt; diff --git a/ntex-rt/CHANGES.md b/ntex-rt/CHANGES.md index 536a64ca..0ecdc9ac 100644 --- a/ntex-rt/CHANGES.md +++ b/ntex-rt/CHANGES.md @@ -1,5 +1,11 @@ # Changes +## [0.4.25] - 2025-03-10 + +* Add "ntex-runtime" support + +* Drop glommio support + ## [0.4.24] - 2025-01-03 * Relax runtime requirements diff --git a/ntex-rt/Cargo.toml b/ntex-rt/Cargo.toml index 752916a8..613bb157 100644 --- a/ntex-rt/Cargo.toml +++ b/ntex-rt/Cargo.toml @@ -20,9 +20,6 @@ path = "src/lib.rs" [features] default = [] -# glommio support -glommio = ["glomm-io", "futures-channel"] - # tokio support tokio = ["tok-io"] @@ -51,7 +48,3 @@ tok-io = { version = "1", package = "tokio", default-features = false, features ntex-runtime = { version = "0.1", optional = true } ntex-iodriver = { version = "0.1", optional = true } - -[target.'cfg(target_os = "linux")'.dependencies] -glomm-io = { version = "0.9", package = "glommio", optional = true } -futures-channel = { version = "0.3", optional = true } diff --git a/ntex-rt/build.rs b/ntex-rt/build.rs index 54b839a9..81f6c0a9 100644 --- a/ntex-rt/build.rs +++ b/ntex-rt/build.rs @@ -7,7 +7,6 @@ fn main() { let _ = match key.as_ref() { "CARGO_FEATURE_COMPIO" => features.insert("compio"), "CARGO_FEATURE_TOKIO" => features.insert("tokio"), - "CARGO_FEATURE_GLOMMIO" => features.insert("glommio"), "CARGO_FEATURE_ASYNC_STD" => features.insert("async-std"), "CARGO_FEATURE_DEFAULT_RT" => features.insert("default-rt"), _ => false, diff --git a/ntex-rt/src/lib.rs b/ntex-rt/src/lib.rs index b2fc2e3c..38446396 100644 --- a/ntex-rt/src/lib.rs +++ b/ntex-rt/src/lib.rs @@ -502,129 +502,12 @@ mod asyncstd { } } -#[allow(dead_code)] -#[cfg(all(feature = "glommio", target_os = "linux"))] -mod glommio { - use std::future::{poll_fn, Future}; - use std::{pin::Pin, task::Context, task::Poll}; - - use futures_channel::oneshot::Canceled; - use glomm_io::task; - - pub type JoinError = Canceled; - - /// Runs the provided future, blocking the current thread until the future - /// completes. - pub fn block_on>(fut: F) { - let ex = glomm_io::LocalExecutor::default(); - ex.run(async move { - let _ = fut.await; - }) - } - - /// Spawn a future on the current thread. This does not create a new Arbiter - /// or Arbiter address, it is simply a helper for spawning futures on the current - /// thread. - /// - /// # Panics - /// - /// This function panics if ntex system is not running. - #[inline] - pub fn spawn(mut f: F) -> JoinHandle - where - F: Future + 'static, - F::Output: 'static, - { - let ptr = crate::CB.with(|cb| (cb.borrow().0)()); - JoinHandle { - fut: Either::Left( - glomm_io::spawn_local(async move { - if let Some(ptr) = ptr { - glomm_io::executor().yield_now().await; - let mut f = unsafe { Pin::new_unchecked(&mut f) }; - let result = poll_fn(|ctx| { - let new_ptr = crate::CB.with(|cb| (cb.borrow().1)(ptr)); - let result = f.as_mut().poll(ctx); - crate::CB.with(|cb| (cb.borrow().2)(new_ptr)); - result - }) - .await; - crate::CB.with(|cb| (cb.borrow().3)(ptr)); - result - } else { - glomm_io::executor().yield_now().await; - f.await - } - }) - .detach(), - ), - } - } - - /// Executes a future on the current thread. This does not create a new Arbiter - /// or Arbiter address, it is simply a helper for executing futures on the current - /// thread. - /// - /// # Panics - /// - /// This function panics if ntex system is not running. - #[inline] - pub fn spawn_fn(f: F) -> JoinHandle - where - F: FnOnce() -> R + 'static, - R: Future + 'static, - { - spawn(async move { f().await }) - } - - pub fn spawn_blocking(f: F) -> JoinHandle - where - F: FnOnce() -> R + Send + 'static, - R: Send + 'static, - { - let fut = glomm_io::executor().spawn_blocking(f); - JoinHandle { - fut: Either::Right(Box::pin(async move { Ok(fut.await) })), - } - } - - enum Either { - Left(T1), - Right(T2), - } - - /// Blocking operation completion future. It resolves with results - /// of blocking function execution. - #[allow(clippy::type_complexity)] - pub struct JoinHandle { - fut: - Either, Pin>>>>, - } - - impl Future for JoinHandle { - type Output = Result; - - fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - match self.fut { - Either::Left(ref mut f) => match Pin::new(f).poll(cx) { - Poll::Pending => Poll::Pending, - Poll::Ready(res) => Poll::Ready(res.ok_or(Canceled)), - }, - Either::Right(ref mut f) => Pin::new(f).poll(cx), - } - } - } -} - #[cfg(feature = "tokio")] pub use self::tokio::*; #[cfg(feature = "async-std")] pub use self::asyncstd::*; -#[cfg(feature = "glommio")] -pub use self::glommio::*; - #[cfg(feature = "compio")] pub use self::compio::*; @@ -636,8 +519,7 @@ pub use self::default_rt::*; not(feature = "tokio"), not(feature = "async-std"), not(feature = "compio"), - not(feature = "default-rt"), - not(feature = "glommio") + not(feature = "default-rt") ))] mod no_rt { use std::task::{Context, Poll}; @@ -701,7 +583,6 @@ mod no_rt { not(feature = "tokio"), not(feature = "async-std"), not(feature = "compio"), - not(feature = "default-rt"), - not(feature = "glommio") + not(feature = "default-rt") ))] pub use self::no_rt::*; diff --git a/ntex/CHANGES.md b/ntex/CHANGES.md index ace6a49a..520d3420 100644 --- a/ntex/CHANGES.md +++ b/ntex/CHANGES.md @@ -1,5 +1,13 @@ # Changes +## [2.12.0] - 2025-03-10 + +* Add "ntex-runtime" support + +* Drop glommio support + +* Drop async-std support + ## [2.11.0] - 2025-01-31 * Cpu affinity support for server diff --git a/ntex/Cargo.toml b/ntex/Cargo.toml index e13d0a14..a1dd99a1 100644 --- a/ntex/Cargo.toml +++ b/ntex/Cargo.toml @@ -45,12 +45,6 @@ url = ["url-pkg"] # tokio runtime tokio = ["ntex-net/tokio"] -# glommio runtime -glommio = ["ntex-net/glommio"] - -# async-std runtime -async-std = ["ntex-net/async-std"] - # compio runtime compio = ["ntex-net/compio"]