atproto-jetstream
WebSocket consumer for AT Protocol Jetstream events.
Overview
Real-time event streaming with Zstandard compression, automatic reconnection, and configurable event filtering for AT Protocol repository changes.
Features
- WebSocket streaming: High-performance event consumption with automatic reconnection handling
- Event filtering: Configurable filtering by collections and DIDs for targeted event processing
- Zstandard compression: Built-in support for compressed event streams with custom dictionaries
- Event handlers: Flexible handler system supporting multiple custom event processors
- Background processing: Asynchronous event processing with graceful shutdown via cancellation tokens
- Structured errors: Comprehensive error handling with detailed error codes
CLI Tools
The following command-line tool is available when built with the clap feature:
atproto-jetstream-consumer: Real-time event stream consumer with filtering, compression, and background processing support
Usage
Basic Event Consumer
use ;
use async_trait;
;
let config = ConsumerTaskConfig ;
let consumer = new;
consumer.register_handler.await?;
let cancellation_token = new;
consumer.run_background.await?;
With Compression
let config = ConsumerTaskConfig ;
// Download dictionary first:
// curl -o data/zstd_dictionary https://github.com/bluesky-social/jetstream/raw/refs/heads/main/pkg/models/zstd_dictionary
Command Line Examples
# Basic streaming
# With compression
# With filtering
License
MIT License