feat: implement Jetstream firehose consumer for real-time feed
Add firehose-based feed that consumes AT Protocol events via Jetstream,
replacing polling for dramatically improved performance:
- Add internal/firehose package with:
- config.go: Jetstream configuration and Arabica collection list
- index.go: BoltDB-backed feed index with multi-key indexes
- consumer.go: WebSocket consumer with reconnection and backoff
- adapter.go: Bridge between firehose and feed service interfaces
- Modify feed service to optionally use firehose index when available
- Add -firehose CLI flag to enable the feature
- Add graceful shutdown handling for firehose consumer
Benefits:
- Real-time feed updates (<1s latency vs 5min cache)
- Zero API calls per feed request (vs ~10N for N users)
- Automatic user discovery from firehose events
- Fallback to polling if firehose unavailable
Co-Authored-By: Claude <noreply@anthropic.com>
authored by
pdewey.com
f5bcd286
f94d1997