Expand description
Coalesced, failover federation fetch of raw event bytes.
Service::fetch is the entry point; behind it a single worker task owns
every in-flight fetch and the dedup map, so no lock guards them. The
per-fetch work splits across the submodules: candidate selection, the
federation transport, and response validation.
Re-exportsยง
use std::sync::Arc;๐use async_trait::async_trait;๐use loole::Receiver;๐use loole::Sender;๐use loole::unbounded;๐use tokio::sync::oneshot;๐use tokio::sync::oneshot::channel;๐use tokio::sync::watch;๐use tuwunel_core::Result;๐use tuwunel_core::implement;๐pub use self::opts::EventWindow;pub use self::opts::FanoutGrowth;pub use self::opts::Op;pub use self::opts::Opts;pub use self::opts::Outcome;use self::error::Failure;๐use self::inflight::Key;๐use self::inflight::Subscription;๐use self::select::RoomCandidates;๐use self::select::Select;๐use self::transport::FederationTransport;๐use self::transport::Transport;๐use crate::services::OnceServices;๐
Modulesยง
- error ๐
- Internal failure reporting for federation fetches.
- inflight ๐
- Single-flight bookkeeping for one in-flight fetch.
- opts ๐
- Caller contract and result types for a fetch:
Optsin,Outcomeout. - select ๐
- Candidate server selection for a fetch.
- transport ๐
- Federation transport: an
Opand target server in, raw response bytes out. - validate ๐
- Two-tier response validation for fetched federation data.
- worker ๐
- The fetch worker loop: one task owning every in-flight fetch, lock-free.
Structsยง
- Msg ๐
- Request to the worker. The worker replies with a subscription to the coalesced result, deferring the reply under backpressure until a slot frees.
- Service
- Coordinates coalesced, validated federation fetches with candidate failover.
Constantsยง
- REQUESTS_
MAX ๐ - Upper bound on concurrent in-flight fetches across all keys.
Functionsยง
- await_
result ๐