Skip to content

Commit

Permalink
Remove Unpin requirements for Arbiter::spawn()
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Dec 10, 2024
1 parent 22ee7f2 commit b53f0c8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ntex-rt/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

## [0.4.23] - 2024-12-10

* Remove Unpin requirements for Arbiter::spawn()

## [0.4.22] - 2024-12-01

* Depend on individual compio packages
Expand Down
2 changes: 1 addition & 1 deletion ntex-rt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ntex-rt"
version = "0.4.22"
version = "0.4.23"
authors = ["ntex contributors <team@ntex.rs>"]
description = "ntex runtime"
keywords = ["network", "framework", "async", "futures"]
Expand Down
6 changes: 3 additions & 3 deletions ntex-rt/src/arbiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub(super) static COUNT: AtomicUsize = AtomicUsize::new(0);

pub(super) enum ArbiterCommand {
Stop,
Execute(Box<dyn Future<Output = ()> + Unpin + Send>),
Execute(Pin<Box<dyn Future<Output = ()> + Send>>),
ExecuteFn(Box<dyn FnExec>),
}

Expand Down Expand Up @@ -147,11 +147,11 @@ impl Arbiter {
/// Send a future to the Arbiter's thread, and spawn it.
pub fn spawn<F>(&self, future: F)
where
F: Future<Output = ()> + Send + Unpin + 'static,
F: Future<Output = ()> + Send + 'static,
{
let _ = self
.sender
.try_send(ArbiterCommand::Execute(Box::new(future)));
.try_send(ArbiterCommand::Execute(Box::pin(future)));
}

/// Send a function to the Arbiter's thread. This function will be executed asynchronously.
Expand Down

0 comments on commit b53f0c8

Please sign in to comment.