mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2025-12-15 19:58:53 -05:00
batch queries to maximize throughput
query-side streams for first level of callsites Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
1792711d09
commit
2259e2c82f
13 changed files with 191 additions and 56 deletions
|
|
@ -2,7 +2,7 @@ use std::{convert::AsRef, fmt::Debug, io::Write, sync::Arc};
|
|||
|
||||
use arrayvec::ArrayVec;
|
||||
use conduwuit::{err, implement, utils::result::MapExpect, Err, Result};
|
||||
use futures::{Future, FutureExt};
|
||||
use futures::{future::ready, Future, FutureExt, TryFutureExt};
|
||||
use serde::Serialize;
|
||||
use tokio::task;
|
||||
|
||||
|
|
@ -79,11 +79,15 @@ where
|
|||
debug_assert!(matches!(cached, Ok(None)), "expected status Incomplete");
|
||||
let cmd = Get {
|
||||
map: self.clone(),
|
||||
key: key.as_ref().into(),
|
||||
key: [key.as_ref().into()].into(),
|
||||
res: None,
|
||||
};
|
||||
|
||||
self.db.pool.execute_get(cmd).boxed()
|
||||
self.db
|
||||
.pool
|
||||
.execute_get(cmd)
|
||||
.and_then(|mut res| ready(res.remove(0)))
|
||||
.boxed()
|
||||
}
|
||||
|
||||
/// Fetch a value from the database into cache, returning a reference-handle.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue