pub struct TapConfig {
pub hostname: String,
pub admin_password: Option<String>,
pub send_acks: bool,
pub user_agent: String,
pub max_reconnect_attempts: Option<u32>,
pub initial_reconnect_delay: Duration,
pub max_reconnect_delay: Duration,
pub reconnect_backoff_multiplier: f64,
pub channel_buffer_size: usize,
}Expand description
Configuration for a TAP stream connection.
Use TapConfig::builder() for ergonomic construction with defaults.
§Example
use atproto_tap::TapConfig;
use std::time::Duration;
let config = TapConfig::builder()
.hostname("localhost:2480")
.admin_password("secret")
.send_acks(true)
.max_reconnect_attempts(Some(10))
.build();Fields§
§hostname: StringTAP service hostname (e.g., “localhost:2480”).
The WebSocket URL is constructed as ws://{hostname}/channel.
admin_password: Option<String>Optional admin password for authentication.
If set, HTTP Basic Auth is used with username “admin”.
send_acks: boolWhether to send acknowledgments for received messages.
Default: true. Set to false if the TAP service has acks disabled.
user_agent: StringUser-Agent header value for WebSocket connections.
max_reconnect_attempts: Option<u32>Maximum reconnection attempts before giving up.
None means unlimited reconnection attempts (default).
initial_reconnect_delay: DurationInitial delay before first reconnection attempt.
Default: 1 second.
max_reconnect_delay: DurationMaximum delay between reconnection attempts.
Default: 60 seconds.
reconnect_backoff_multiplier: f64Multiplier for exponential backoff between reconnections.
Default: 2.0 (doubles the delay each attempt).
channel_buffer_size: usizeSize of the internal channel buffer between the WebSocket reader and consumer.
A larger buffer absorbs more burst latency when the consumer has occasional slow processing. Default: 32.
Implementations§
Source§impl TapConfig
impl TapConfig
Sourcepub fn builder() -> TapConfigBuilder
pub fn builder() -> TapConfigBuilder
Create a new configuration builder with defaults.
Sourcepub fn new(hostname: impl Into<String>) -> Self
pub fn new(hostname: impl Into<String>) -> Self
Create a minimal configuration for the given hostname.
Sourcepub fn http_base_url(&self) -> String
pub fn http_base_url(&self) -> String
Returns the HTTP base URL for the TAP management API.