pub struct JetstreamConfig {
pub endpoint: String,
pub wanted_collections: Vec<Nsid>,
pub wanted_dids: Vec<Did>,
pub compression: JetstreamCompression,
pub cursor: Option<DateTime<Utc>>,
pub max_retries: u32,
pub max_delay_ms: u64,
pub base_delay_ms: u64,
pub reset_retries_min_ms: u64,
}Fields§
§endpoint: StringA Jetstream endpoint to connect to with a WebSocket Scheme i.e.
wss://jetstream1.us-east.bsky.network/subscribe.
wanted_collections: Vec<Nsid>A list of collection NSIDs to filter events for.
An empty list will receive events for all collections.
Regardless of desired collections, all subscribers receive AccountEvent and IdentityEvent events.
wanted_dids: Vec<Did>A list of repo DIDs to filter events for.
An empty list will receive events for all repos, which is a lot of events!
compression: JetstreamCompressionThe compression algorithm to request and use for the WebSocket connection (if any).
cursor: Option<DateTime<Utc>>An optional timestamp to begin playback from.
An absent cursor or a cursor from the future will result in live-tail operation.
When reconnecting, use the time_us from your most recently processed event and maybe provide a negative buffer (i.e. subtract a few seconds) to ensure gapless playback.
max_retries: u32§max_delay_ms: u64§base_delay_ms: u64§reset_retries_min_ms: u64Implementations§
Source§impl JetstreamConfig
impl JetstreamConfig
Sourcepub fn construct_endpoint(&self, endpoint: &str) -> Result<Url, ParseError>
pub fn construct_endpoint(&self, endpoint: &str) -> Result<Url, ParseError>
Constructs a new endpoint URL with the given JetstreamConfig applied.
Sourcepub fn validate(&self) -> Result<(), ConfigValidationError>
pub fn validate(&self) -> Result<(), ConfigValidationError>
Validates the configuration to make sure it is within the limits of the Jetstream API.
§Constants
The following constants are used to validate the configuration and should only be changed if the Jetstream API has itself changed.
- [MAX_WANTED_COLLECTIONS]
- [MAX_WANTED_DIDS]