Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions vortex-io/src/runtime/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<dyn FnOnce() + Send + 'static>) -> 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<dyn FnOnce() + Send + 'static>) -> AbortHandleRef {
Box::new(
tokio::runtime::Handle::current()
.spawn_blocking(task)
.abort_handle(),
)
Executor::spawn_blocking_io(&tokio::runtime::Handle::current(), task)
}
}

Expand Down Expand Up @@ -159,13 +151,11 @@ impl BlockingRuntime for TokioRuntime {
}
}

#[cfg(feature = "tokio")]
Comment thread
a10y marked this conversation as resolved.
pub struct TokioBlockingIterator<'a, T> {
handle: Arc<tokio::runtime::Handle>,
stream: futures::stream::BoxStream<'a, T>,
}

#[cfg(feature = "tokio")]
impl<T> Iterator for TokioBlockingIterator<'_, T> {
type Item = T;

Expand Down
Loading