furnish batch interface with trait
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
4a2d0d35bc
commit
d0b4a619af
8 changed files with 155 additions and 93 deletions
|
@ -7,7 +7,7 @@ use conduwuit::{
|
|||
utils::{stream::TryIgnore, IterStream, ReadyExt},
|
||||
Result,
|
||||
};
|
||||
use database::{Database, Deserialized, Handle, Interfix, Map};
|
||||
use database::{Database, Deserialized, Handle, Interfix, Map, Qry};
|
||||
use futures::{pin_mut, Stream, StreamExt};
|
||||
use ruma::{api::client::filter::LazyLoadOptions, DeviceId, OwnedUserId, RoomId, UserId};
|
||||
|
||||
|
@ -115,9 +115,11 @@ where
|
|||
let make_key =
|
||||
|sender: &'a UserId| -> Key<'a> { (ctx.user_id, ctx.device_id, ctx.room_id, sender) };
|
||||
|
||||
self.db
|
||||
.lazyloadedids
|
||||
.qry_batch(senders.clone().stream().map(make_key))
|
||||
senders
|
||||
.clone()
|
||||
.stream()
|
||||
.map(make_key)
|
||||
.qry(&self.db.lazyloadedids)
|
||||
.map(into_status)
|
||||
.zip(senders.stream())
|
||||
.map(move |(status, sender)| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue