From 63bcb021c4efe335fc44e8d0b08896ac322f8a65 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Fri, 27 Mar 2026 16:03:34 +0000 Subject: [PATCH] Make sure all tokio runtime propegate observability in the same way Signed-off-by: Adam Gutglick --- vortex-io/src/runtime/tokio.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/vortex-io/src/runtime/tokio.rs b/vortex-io/src/runtime/tokio.rs index e4fd7095361..4e386718b83 100644 --- a/vortex-io/src/runtime/tokio.rs +++ b/vortex-io/src/runtime/tokio.rs @@ -95,23 +95,15 @@ struct CurrentTokioRuntime; impl Executor for CurrentTokioRuntime { fn spawn(&self, fut: BoxFuture<'static, ()>) -> AbortHandleRef { - Box::new(tokio::runtime::Handle::current().spawn(fut).abort_handle()) + Executor::spawn(&tokio::runtime::Handle::current(), fut) } fn spawn_cpu(&self, cpu: Box) -> AbortHandleRef { - Box::new( - tokio::runtime::Handle::current() - .spawn(async move { cpu() }) - .abort_handle(), - ) + Executor::spawn_cpu(&tokio::runtime::Handle::current(), cpu) } fn spawn_blocking_io(&self, task: Box) -> AbortHandleRef { - Box::new( - tokio::runtime::Handle::current() - .spawn_blocking(task) - .abort_handle(), - ) + Executor::spawn_blocking_io(&tokio::runtime::Handle::current(), task) } } @@ -159,13 +151,11 @@ impl BlockingRuntime for TokioRuntime { } } -#[cfg(feature = "tokio")] pub struct TokioBlockingIterator<'a, T> { handle: Arc, stream: futures::stream::BoxStream<'a, T>, } -#[cfg(feature = "tokio")] impl Iterator for TokioBlockingIterator<'_, T> { type Item = T;