HTTP Streaming
This project addresses the absence of HTTP streaming support in the Rage framework, where responses are currently fully buffered before being sent to the client. This limitation prevents real-time use cases such as incremental LLM outputs, live data feeds, and large streaming responses. Even when applications generate data in chunks, the Iodine server collects all output into a buffer and sends it only after completion, making true streaming impossible. To solve this, the project introduces native HTTP streaming using chunked transfer encoding across both Iodine (C layer) and Rage (Ruby layer). A new streaming path will be added to Iodine to support incremental writes with a robust backpressure mechanism, ensuring the event loop remains non-blocking. On the Rage side, a developer-friendly API (render stream:) will be implemented using enumerators and fibers, allowing applications to stream data declaratively while seamlessly handling pause/resume behaviour under backpressure. The deliverables include implementing the http_stream transport, a Rack-compatible streaming writer with lifecycle and backpressure management, and the Rage streaming API. The project will also provide integration tests, edge-case handling (e.g., disconnects, high load), and updated documentation. This enables real-time streaming in Rage while preserving compatibility and supporting future extensions like HTTP/2.
Project details
Technologies
Not listed in the archive