Context
- SSE helper exists (
oxyroute/sse.py) using Granian response_stream.
- No generic streaming helpers for bytes/text/NDJSON beyond SSE.
Problem
Handlers that stream downloads, logs, AI tokens, or proxy responses must use low-level protocol APIs directly.
Proposed change
- Add
oxyroute.streaming (or extend oxyroute/sse.py) with helpers such as:
stream_text(async_iter, ...)
stream_bytes(async_iter, ...)
- optional
stream_jsonl(async_iter, ...)
- Correct headers, error handling, and documentation for backpressure limits.
Files
oxyroute/streaming.py (or sse.py), src/dispatch.rs if sentinel integration needed
docs/, tests
Acceptance criteria
- Streaming text/bytes routes covered by tests.
- Existing SSE tests still pass.
- Docs describe error and backpressure behaviour.
Framework impact
Enables common streaming use cases without touching Granian protocol directly.
Context
oxyroute/sse.py) using Granianresponse_stream.Problem
Handlers that stream downloads, logs, AI tokens, or proxy responses must use low-level
protocolAPIs directly.Proposed change
oxyroute.streaming(or extendoxyroute/sse.py) with helpers such as:stream_text(async_iter, ...)stream_bytes(async_iter, ...)stream_jsonl(async_iter, ...)Files
oxyroute/streaming.py(orsse.py),src/dispatch.rsif sentinel integration neededdocs/, testsAcceptance criteria
Framework impact
Enables common streaming use cases without touching Granian protocol directly.