offload initial iterator seeks to threadpool

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-12-02 08:51:59 +00:00
parent 320b0680bd
commit b5006a4c41
20 changed files with 361 additions and 131 deletions

View file

@ -1,4 +1,4 @@
use std::{convert::AsRef, fmt::Debug};
use std::{convert::AsRef, fmt::Debug, sync::Arc};
use conduit::{implement, Result};
use futures::{
@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
use crate::keyval::{result_deserialize_key, serialize_key, Key};
#[implement(super::Map)]
pub fn rev_keys_prefix<'a, K, P>(&'a self, prefix: &P) -> impl Stream<Item = Result<Key<'_, K>>> + Send
pub fn rev_keys_prefix<'a, K, P>(self: &'a Arc<Self>, prefix: &P) -> impl Stream<Item = Result<Key<'_, K>>> + Send
where
P: Serialize + ?Sized + Debug,
K: Deserialize<'a> + Send,
@ -22,7 +22,7 @@ where
#[implement(super::Map)]
#[tracing::instrument(skip(self), level = "trace")]
pub fn rev_keys_prefix_raw<P>(&self, prefix: &P) -> impl Stream<Item = Result<Key<'_>>> + Send
pub fn rev_keys_prefix_raw<P>(self: &Arc<Self>, prefix: &P) -> impl Stream<Item = Result<Key<'_>>> + Send
where
P: Serialize + ?Sized + Debug,
{
@ -32,7 +32,9 @@ where
}
#[implement(super::Map)]
pub fn rev_keys_raw_prefix<'a, K, P>(&'a self, prefix: &'a P) -> impl Stream<Item = Result<Key<'_, K>>> + Send + 'a
pub fn rev_keys_raw_prefix<'a, K, P>(
self: &'a Arc<Self>, prefix: &'a P,
) -> impl Stream<Item = Result<Key<'_, K>>> + Send + 'a
where
P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a,
K: Deserialize<'a> + Send + 'a,
@ -42,7 +44,7 @@ where
}
#[implement(super::Map)]
pub fn rev_raw_keys_prefix<'a, P>(&'a self, prefix: &'a P) -> impl Stream<Item = Result<Key<'_>>> + Send + 'a
pub fn rev_raw_keys_prefix<'a, P>(self: &'a Arc<Self>, prefix: &'a P) -> impl Stream<Item = Result<Key<'_>>> + Send + 'a
where
P: AsRef<[u8]> + ?Sized + Debug + Sync + 'a,
{