Skip to content

[EPIC] v0.2.0: Streaming Support & High-Performance I/O#11

Description

@Bernardusz

馃搩 Description

To support large file transfers and real-time data streaming without memory exhaustion, Levtus needs a coordinated refactor of its I/O layer. This Epic tracks the transition from a "buffered-only" engine to a "streaming-first" engine.

馃搼 Requirements:

[ ] Core: Implement bodyStream() for Request (OOM Protection)
[ ] Protocol: Add 100-Continue Handshake (Bandwidth Efficiency)
[ ] Routing: Implement Route-specific maxBodySize overrides
[ ] Performance: Add Zero-Copy ctx.file() response support
[ ] Compliance: Implement Chunked Transfer Encoding (RFC 9112)

馃毄Constraint

  1. Stick to the philosophy, no dependency
  2. All I/O must be blocking-compatible for Virtual threads, and avoid synchronized blocks that pin threads.
  3. The engine must never buffer more than 8KB of a request unless explicitly requested via a config change.
  4. Every implementation must strictly follow a specific RFC requirement. A deviation must be documented as a deliberate design choice in the sub-issue.

馃専Target

The end goal should be:

  1. User can stream/download data without the server being exhausted by Sloworis or OOM Error.
  2. The developer can define the maxBodySize for each API; the default should be 10MB.
  3. The user can send data in chunks using Chunked Transfer Encoding or in 100-Continue Handshake
  4. The .bodyStream() will use a new LevtusInputStream that extends InputStream.
  5. The .body() use .bodyStream() method internally and will use as little RAM as possible.

馃摎 References

README.md
RFIC 9112
CONTRIBUTING.md

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededrefactorIntroduces change(s) that don't break, nor add any features, nor fix any bugs.

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions