Repository navigation
v0.5.0 -- SSE connector and architecture decision records
New crate: pipe-http
Server-Sent Events (SSE) source for consuming HTTP event streams.
use pipe_http::sse;
sse::connect("https://example.com/events")
.filter(|e| e.event.as_deref() == Some("update"))
.map(|e| e.data)
.for_each(|data| println!("{data}"))
.await?;Features
sse::connect(url)-- returnsPipe<SseEvent>with auto-reconnectionsse::connect_with(SseConfig)-- custom headers, backoff,Last-Event-IDresume- W3C EventSource spec-compliant parser: event/data/id/retry fields, multiline data, comments, BOM stripping, null-in-id rejection
- 16 MiB line buffer limit to prevent OOM from malicious servers
- Strict UTF-8 validation (rejects invalid bytes)
- Smart reconnection: retries on 5xx and connection errors, fails immediately on 4xx
- Server
retry:field honored for backoff tuning - 22 tests (16 unit + 6 integration against in-process axum server)
- Example:
sse_consumerconnecting to Wikimedia recent changes stream
Install
[dependencies]
pipe-http = { git = "https://github.com/hamidr/pipe" }Architecture Decision Records
- ADR-001: Operator fusion strategy (deferred -- optimize after users, not before)
- ADR-002: Connector strategy -- SSE first, then WebSocket, then message brokers
docs/TRACKER.mdfor ADR/PRD tracking