xmtp_configuration/common/streams.rs
1//! Default client bounds for durable receipt and local delivery.
2
3use std::time::Duration;
4
5/// Maximum rows in one admission transaction or fetched page.
6pub const STREAM_BATCH_ROWS: u32 = 128;
7/// Maximum encoded bytes in one admission transaction or fetched page.
8pub const STREAM_BATCH_BYTES: u64 = 32 * 1024 * 1024;
9/// Maximum pending rows for one topic.
10pub const STREAM_TOPIC_ROWS: u64 = 1024;
11/// Maximum pending encoded bytes for one topic.
12pub const STREAM_TOPIC_BYTES: u64 = 64 * 1024 * 1024;
13/// Maximum pending group rows across all group topics.
14pub const STREAM_GROUP_ROWS: u64 = 8192;
15/// Maximum pending group bytes across all group topics.
16pub const STREAM_GROUP_BYTES: u64 = 128 * 1024 * 1024;
17/// Reserved pending Welcome rows, separate from group and identity capacity.
18pub const STREAM_WELCOME_ROWS: u64 = 1024;
19/// Reserved pending Welcome bytes.
20pub const STREAM_WELCOME_BYTES: u64 = 64 * 1024 * 1024;
21/// Reserved pending identity rows, separate from group and Welcome capacity.
22pub const STREAM_IDENTITY_ROWS: u64 = 4096;
23/// Reserved pending identity bytes.
24pub const STREAM_IDENTITY_BYTES: u64 = 32 * 1024 * 1024;
25/// Maximum rows returned by one local message read.
26pub const STREAM_LOCAL_READ_ROWS: u32 = 128;
27/// Maximum decoded bytes returned by one local message read.
28pub const STREAM_LOCAL_READ_BYTES: u64 = 16 * 1024 * 1024;
29/// Maximum delay before a receiver with no progress falls back to Query.
30pub const RECEIVER_FALLBACK_INTERVAL: Duration = Duration::from_secs(1);
31/// Maximum delay between fresh database checks while work is active.
32pub const ACTIVE_DATABASE_POLL_INTERVAL: Duration = Duration::from_millis(250);
33/// Lease duration for the default app message consumer.
34pub const DEFAULT_CONSUMER_LEASE_DURATION: Duration = Duration::from_secs(30);
35/// Maximum duration of one bounded catch-up operation.
36pub const STREAM_BARRIER_TIMEOUT: Duration = Duration::from_secs(60);
37/// How often a long-lived client rechecks Welcomes it could not process, so
38/// their retention deadline is reached without restarting the client.
39pub const STREAM_BLOCKED_WELCOME_RESCAN_INTERVAL: Duration = Duration::from_secs(3600);
40/// First delay before retrying a receiver that failed with a permanent error.
41/// A permanent classification describes this response, not every later one, so
42/// the retry never stops. It only slows down.
43pub const STREAM_PERMANENT_RETRY_INITIAL: Duration = Duration::from_secs(5);
44/// Longest delay between retries of a receiver that keeps failing permanently.
45pub const STREAM_PERMANENT_RETRY_MAX: Duration = Duration::from_secs(300);