Split fetch_outlier; abstract backoff stanzas into fn.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-08-02 04:59:58 +00:00
parent 4b9b85f671
commit d217927000
7 changed files with 203 additions and 231 deletions

View File

@@ -1,11 +1,11 @@
use std::{
collections::{BTreeMap, HashMap, HashSet, VecDeque},
collections::{HashMap, HashSet, VecDeque},
iter::once,
};
use futures::FutureExt;
use ruma::{
CanonicalJsonValue, EventId, MilliSecondsSinceUnixEpoch, OwnedEventId, RoomId, ServerName,
CanonicalJsonObject, EventId, MilliSecondsSinceUnixEpoch, OwnedEventId, RoomId, ServerName,
int, uint,
};
use tuwunel_core::{
@@ -30,10 +30,7 @@ pub(super) async fn fetch_prev<'a, Pdu, Events>(
room_id: &RoomId,
first_ts_in_room: MilliSecondsSinceUnixEpoch,
initial_set: Events,
) -> Result<(
Vec<OwnedEventId>,
HashMap<OwnedEventId, (PduEvent, BTreeMap<String, CanonicalJsonValue>)>,
)>
) -> Result<(Vec<OwnedEventId>, HashMap<OwnedEventId, (PduEvent, CanonicalJsonObject)>)>
where
Pdu: Event,
Events: Iterator<Item = &'a EventId> + Clone + Send,