Skip to content

v0.5.0 -- SSE connector and architecture decision records

Choose a tag to compare

@hamidr hamidr released this 11 Apr 09:11
· 73 commits to main since this release

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) -- returns Pipe<SseEvent> with auto-reconnection
  • sse::connect_with(SseConfig) -- custom headers, backoff, Last-Event-ID resume
  • 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_consumer connecting 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.md for ADR/PRD tracking