This commit is contained in:
Nikolay Kim 2025-03-12 01:15:32 +05:00 committed by GitHub
parent dcc08b72d8
commit db16b71c5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 6 deletions

View file

@ -2,8 +2,6 @@
## [0.4.27] - 2025-03-14
* Add Arbiter::spawn_with()
* Add "neon" runtime support
* Drop glommio support

View file

@ -1,6 +1,6 @@
[package]
name = "ntex-rt"
version = "0.4.26"
version = "0.4.27"
authors = ["ntex contributors <team@ntex.rs>"]
description = "ntex runtime"
keywords = ["network", "framework", "async", "futures"]

View file

@ -154,13 +154,17 @@ impl Arbiter {
.try_send(ArbiterCommand::Execute(Box::pin(future)));
}
#[rustfmt::skip]
/// Send a function to the Arbiter's thread and spawns it's resulting future.
/// This can be used to spawn non-send futures on the arbiter thread.
pub fn spawn_with<F, R, O>(&self, f: F) -> impl Future<Output = Result<O, oneshot::RecvError>> + Send + 'static
pub fn spawn_with<F, R, O>(
&self,
f: F
) -> impl Future<Output = Result<O, oneshot::RecvError>> + Send + 'static
where
F: FnOnce() -> R + Send + 'static,
R: Future<Output = O> + 'static,
O: Send + 'static
O: Send + 'static,
{
let (tx, rx) = oneshot::channel();
let _ = self

View file

@ -70,7 +70,7 @@ ntex-util = "2.8"
ntex-bytes = "0.1.27"
ntex-server = "2.7"
ntex-h2 = "1.8.1"
ntex-rt = "0.4.26"
ntex-rt = "0.4.27"
ntex-io = "2.11"
ntex-net = "2.5"
ntex-tls = "2.3"