Skip to content

Commit ab4ac88

Browse files
committed
merge
Signed-off-by: Nicholas Gates <[email protected]>
1 parent 90fcf41 commit ab4ac88

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vortex-cxx/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ crate-type = ["staticlib"]
2424
anyhow = { workspace = true }
2525
arrow-array = { workspace = true, features = ["ffi"] }
2626
arrow-schema = { workspace = true }
27+
async-fs = { workspace = true }
2728
cxx = "1.0"
2829
futures = { workspace = true }
2930
paste = { workspace = true }
3031
take_mut = { workspace = true }
31-
tokio = { workspace = true, features = ["rt", "rt-multi-thread", "macros"] }
32-
vortex = { workspace = true, features = ["tokio"] }
32+
vortex = { workspace = true }
3333

3434
[build-dependencies]
3535
cxx-build = "1.0"

vortex-cxx/src/write.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,21 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
use std::sync::LazyLock;
5-
64
use anyhow::Result;
75
use arrow_array::RecordBatchReader;
86
use arrow_array::ffi_stream::{ArrowArrayStreamReader, FFI_ArrowArrayStream};
9-
use tokio::runtime::Runtime;
107
use vortex::ArrayRef;
118
use vortex::arrow::FromArrowArray;
129
use vortex::dtype::DType;
1310
use vortex::dtype::arrow::FromArrowType;
14-
use vortex::error::{VortexError, VortexExpect};
11+
use vortex::error::VortexError;
1512
use vortex::file::{VortexWriteOptions as WriteOptions, WriteOptionsSessionExt};
1613
use vortex::io::VortexWrite;
14+
use vortex::io::runtime::BlockingRuntime;
1715
use vortex::iter::{ArrayIteratorAdapter, ArrayIteratorExt};
1816
use vortex::stream::ArrayStream;
1917

20-
use crate::SESSION;
21-
22-
/// The tokio runtime for the write-side.
23-
static RUNTIME: LazyLock<Runtime> = LazyLock::new(|| {
24-
Runtime::new()
25-
.map_err(VortexError::from)
26-
.vortex_expect("Failed to create tokio runtime")
27-
});
18+
use crate::{RUNTIME, SESSION};
2819

2920
pub(crate) struct VortexWriteOptions {
3021
inner: WriteOptions,
@@ -67,7 +58,7 @@ pub(crate) unsafe fn write_array_stream(
6758
let vortex_stream = arrow_stream_to_vortex_stream(stream_reader)?;
6859

6960
RUNTIME.block_on(async {
70-
let mut file = tokio::fs::File::create(path).await?;
61+
let mut file = async_fs::File::create(path).await?;
7162
options.inner.write(&mut file, vortex_stream).await?;
7263
file.shutdown().await?;
7364
Ok(())

0 commit comments

Comments
 (0)