Skip to content

feat(streaming): generic streaming response helpers beyond SSE #103

Description

@ZhuchkaTriplesix

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions