From 09d1a23c04c36ab3542812658c56f4dec0cf6ef8 Mon Sep 17 00:00:00 2001 From: Gwo Tzu-Hsing Date: Mon, 16 Dec 2024 20:07:05 +0800 Subject: [PATCH] fix: change TokioExecutor::default to TokioExecutor::current --- README.md | 2 +- benches/criterion/writes.rs | 2 +- bindings/python/src/db.rs | 2 +- examples/datafusion.rs | 2 +- src/lib.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 97d787e9..341f81a8 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ pub struct User { #[tokio::main] async fn main() { // pluggable async runtime and I/O - let db = DB::new("./db_path/users".into(), TokioExecutor::default()) + let db = DB::new("./db_path/users".into(), TokioExecutor::current()) .await .unwrap(); diff --git a/benches/criterion/writes.rs b/benches/criterion/writes.rs index 41f3af21..4e102597 100644 --- a/benches/criterion/writes.rs +++ b/benches/criterion/writes.rs @@ -61,7 +61,7 @@ fn single_write(c: &mut Criterion) { let option = DbOption::from(fusio::path::Path::from_filesystem_path("/tmp/tonbo").unwrap()) .disable_wal(); let db = runtime - .block_on(async { DB::new(option, TokioExecutor::default()).await }) + .block_on(async { DB::new(option, TokioExecutor::current()).await }) .unwrap(); group.bench_with_input(BenchmarkId::new("Tonbo", batch), &batch, |b, batch| { diff --git a/bindings/python/src/db.rs b/bindings/python/src/db.rs index 840ff728..8db90b0e 100644 --- a/bindings/python/src/db.rs +++ b/bindings/python/src/db.rs @@ -62,7 +62,7 @@ impl TonboDB { .block_on(async { DB::with_schema( option, - TokioExecutor::new(), + TokioExecutor::current(), desc, primary_key_index.unwrap(), ) diff --git a/examples/datafusion.rs b/examples/datafusion.rs index 2b7dd167..5214f005 100644 --- a/examples/datafusion.rs +++ b/examples/datafusion.rs @@ -217,7 +217,7 @@ async fn main() -> Result<()> { let options = DbOption::from(Path::from_filesystem_path("./db_path/music").unwrap()); - let db = DB::new(options, TokioExecutor::default()).await.unwrap(); + let db = DB::new(options, TokioExecutor::current()).await.unwrap(); for (id, name, like) in [ (0, "welcome".to_string(), 0), (1, "tonbo".to_string(), 999), diff --git a/src/lib.rs b/src/lib.rs index b357fe66..6719d412 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -56,7 +56,7 @@ //! //! let options = DbOption::from(Path::from_filesystem_path("./db_path/users").unwrap()); //! // pluggable async runtime and I/O -//! let db = DB::new(options, TokioExecutor::default()).await.unwrap(); +//! let db = DB::new(options, TokioExecutor::current()).await.unwrap(); //! // insert with owned value //! db.insert(User { //! name: "Alice".into(),