fix: correct set up sandboxing for AsyncDerived futures

This commit is contained in:
Greg Johnston
2025-06-11 21:31:31 -04:00
parent a9ab4ea372
commit 32e0551b10

View File

@@ -484,7 +484,10 @@ impl<T: 'static> ArcAsyncDerived<T> {
{
let fun = move || {
let fut = fun();
async move { SendOption::new(Some(fut.await)) }
let fut = async move { SendOption::new(Some(fut.await)) };
#[cfg(feature = "sandboxed-arenas")]
let fut = Sandboxed::new(fut);
fut
};
let initial_value = SendOption::new(initial_value);
let (this, _) = spawn_derived!(
@@ -518,9 +521,12 @@ impl<T: 'static> ArcAsyncDerived<T> {
{
let fun = move || {
let fut = fun();
ScopedFuture::new_untracked(async move {
let fut = ScopedFuture::new_untracked(async move {
SendOption::new(Some(fut.await))
})
});
#[cfg(feature = "sandboxed-arenas")]
let fut = Sandboxed::new(fut);
fut
};
let initial_value = SendOption::new(initial_value);
let (this, _) = spawn_derived!(
@@ -562,7 +568,10 @@ impl<T: 'static> ArcAsyncDerived<T> {
{
let fun = move || {
let fut = fun();
async move { SendOption::new_local(Some(fut.await)) }
let fut = async move { SendOption::new_local(Some(fut.await)) };
#[cfg(feature = "sandboxed-arenas")]
let fut = Sandboxed::new(fut);
fut
};
let initial_value = SendOption::new_local(initial_value);
let (this, _) = spawn_derived!(
@@ -598,7 +607,10 @@ impl<T: 'static> ArcAsyncDerived<T> {
let initial = SendOption::new_local(None::<T>);
let fun = move || {
let fut = fun();
async move { SendOption::new_local(Some(fut.await)) }
let fut = async move { SendOption::new_local(Some(fut.await)) };
#[cfg(feature = "sandboxed-arenas")]
let fut = Sandboxed::new(fut);
fut
};
let (this, _) = spawn_derived!(
crate::spawn_local,