implement several broadband loops
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
59d5e3ebf1
commit
1d02851028
7 changed files with 47 additions and 22 deletions
|
@ -1,10 +1,10 @@
|
|||
use axum::extract::State;
|
||||
use conduit::{
|
||||
at,
|
||||
utils::{result::FlatOk, IterStream, ReadyExt},
|
||||
utils::{result::FlatOk, stream::WidebandExt, IterStream, ReadyExt},
|
||||
PduCount, Result,
|
||||
};
|
||||
use futures::{FutureExt, StreamExt};
|
||||
use futures::StreamExt;
|
||||
use ruma::{
|
||||
api::{
|
||||
client::relations::{
|
||||
|
@ -138,11 +138,10 @@ async fn paginate_relations_with_filter(
|
|||
.is_none_or(|rel_type| pdu.relation_type_equal(rel_type))
|
||||
})
|
||||
.stream()
|
||||
.filter_map(|item| visibility_filter(services, sender_user, item))
|
||||
.ready_take_while(|(count, _)| Some(*count) != to)
|
||||
.wide_filter_map(|item| visibility_filter(services, sender_user, item))
|
||||
.take(limit)
|
||||
.collect()
|
||||
.boxed()
|
||||
.await;
|
||||
|
||||
let next_batch = match dir {
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
mod v3;
|
||||
mod v4;
|
||||
|
||||
use conduit::{utils::ReadyExt, PduCount};
|
||||
use conduit::{
|
||||
utils::stream::{BroadbandExt, ReadyExt},
|
||||
PduCount,
|
||||
};
|
||||
use futures::StreamExt;
|
||||
use ruma::{RoomId, UserId};
|
||||
|
||||
|
@ -55,7 +58,7 @@ async fn share_encrypted_room(
|
|||
.state_cache
|
||||
.get_shared_rooms(sender_user, user_id)
|
||||
.ready_filter(|&room_id| Some(room_id) != ignore_room)
|
||||
.any(|other_room_id| {
|
||||
.broad_any(|other_room_id| {
|
||||
services
|
||||
.rooms
|
||||
.state_accessor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue