Expand description
Delayed events (MSC4140): events scheduled now and sent later.
A scheduled event is three rows written in one batch: its record, a due-time index entry, and an owner index entry. The worker sends each event when it falls due through the ordinary append path, so events overdue at startup go out on its first pass. Whatever the outcome, one batch then replaces the three rows with a finalised record, and a crash between the two steps can send an event twice. Finalised records are kept for about a week, or less once their column reaches its size cap.
Re-exportsΒ§
use std::collections::BTreeMap;πuse std::pin::pin;πuse std::sync::Arc;πuse std::time::Duration;πuse async_trait::async_trait;πuse futures::Stream;πuse futures::StreamExt;πuse futures::TryFutureExt;πuse futures::future::Either;πuse futures::future::select;πuse futures::stream::unfold;πuse http::StatusCode;πuse ruma::EventId;πuse ruma::MilliSecondsSinceUnixEpoch;πuse ruma::OwnedEventId;πuse ruma::OwnedRoomId;πuse ruma::OwnedUserId;πuse ruma::UserId;πuse ruma::api::client::delayed_events::get_delayed_event::v1::Finalized;πuse ruma::api::error::ErrorKind;πuse ruma::api::error::LimitExceededErrorData;πuse ruma::api::error::RetryAfter;πuse ruma::api::error::StandardErrorBody;πuse ruma::events::TimelineEventType;πuse serde::Deserialize;πuse serde::Deserialize;πuse serde::Serialize;πuse serde::Serialize;πuse tokio::sync::Notify;πuse tokio::time::timeout;πuse tuwunel_core::Err;πuse tuwunel_core::Error;πuse tuwunel_core::Result;πuse tuwunel_core::debug_warn;πuse tuwunel_core::err;πuse tuwunel_core::error;πuse tuwunel_core::error;πuse tuwunel_core::implement;πuse tuwunel_core::result::NotFound;πuse tuwunel_core::smallstr::SmallString;πuse tuwunel_core::utils::MutexMap;πuse tuwunel_core::utils::MutexMapGuard;πuse tuwunel_core::utils::rand::string_array;πuse tuwunel_core::utils::stream::BroadbandExt;πuse tuwunel_core::utils::stream::ReadyExt;πuse tuwunel_core::utils::stream::TryIgnore;πuse tuwunel_core::utils::stream::WidebandExt;πuse tuwunel_core::utils::stream::automatic_width;πuse tuwunel_core::utils::time::now_millis;πuse tuwunel_core::warn;πuse tuwunel_database::Deserialized;πuse tuwunel_database::Ignore;πuse tuwunel_database::Interfix;πuse tuwunel_database::Json;πuse tuwunel_database::Map;πuse tuwunel_matrix::StateKey;πuse tuwunel_matrix::pdu::Content;πuse tuwunel_matrix::pdu::DELAY_ID;πuse tuwunel_matrix::pdu::PduBuilder;πuse crate::service::make_name;πuse crate::transaction_ids::RoomScope;πuse crate::transaction_ids::RoomTxn;π
StructsΒ§
- Data π
- Event
- A delayed event as stored, scheduled or finalised, and as reported to its owner.
- Limits
- The limits a client is told about and held to.
- Service
- Schedules delayed events and sends them when they fall due.
ConstantsΒ§
- DELAY_
ID_ πLEN - MAX_
WAIT π - SEND_
WIDTH π
FunctionsΒ§
- conflict π
- limit_
exceeded π - log_
send_ πerror - Logs a failed send, at warning level only when the server is at fault.
- outcome π
- Records a sendβs outcome with the time it was finalised.
- read_
event π
Type AliasesΒ§
- DelayId
- A
delay_id, as this server issues it or a client names it.