mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-27 01:54:47 -07:00
global: snapshot
This commit is contained in:
18
crates/brk_query/src/async.rs
Normal file
18
crates/brk_query/src/async.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
// Should be async
|
||||
// anything related to IO should use
|
||||
//
|
||||
// Sync function
|
||||
// fn get(db: &CandyStore, key: &str) -> Option<Vec<u8>> {
|
||||
// db.get(key).ok().flatten()
|
||||
// }
|
||||
|
||||
use crate::Query;
|
||||
|
||||
// // Async function
|
||||
// async fn get_async(db: Arc<CandyStore>, key: String) -> Option<Vec<u8>> {
|
||||
// tokio::task::spawn_blocking(move || {
|
||||
// db.get(&key).ok().flatten()
|
||||
// }).await.ok()?
|
||||
// }
|
||||
#[derive(Clone)]
|
||||
pub struct AsyncQuery(Query);
|
||||
@@ -13,6 +13,7 @@ use brk_types::{
|
||||
};
|
||||
use vecdb::{AnyCollectableVec, AnyStoredVec};
|
||||
|
||||
mod r#async;
|
||||
mod chain;
|
||||
mod deser;
|
||||
mod output;
|
||||
@@ -20,6 +21,7 @@ mod pagination;
|
||||
mod params;
|
||||
mod vecs;
|
||||
|
||||
pub use r#async::*;
|
||||
pub use output::{Output, Value};
|
||||
pub use pagination::{PaginatedIndexParam, PaginatedMetrics, PaginationParam};
|
||||
pub use params::{Params, ParamsDeprec, ParamsOpt};
|
||||
|
||||
Reference in New Issue
Block a user