-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Problem to Solve
Problem
Relic doesn't support unbuffered streaming responses, making Server-Sent Events (SSE) impossible.
Expected Behavior
When using Body.fromDataStream() with an open-ended stream, data should be sent to the client as it's added to the stream, not buffered until the stream closes.
Current Behavior
Data added to the stream is buffered and never sent to the client. The client receives headers (200 OK, transfer-encoding: chunked) but 0 bytes of body data, even though the server code is adding data to the stream.
Proposal
Context
Shelf supports this via the context parameter with 'shelf.io.buffer_output': false:
return Response.ok(
controller.stream.transform(utf8.encoder),
context: {'shelf.io.buffer_output': false},
);
Use Case
Relic needs an equivalent mechanism to disable output buffering for SSE and long-polling use cases.
Alternatives
Web Sockets but that's a lot of overhead for just server side status updates.
Additional context
No response
How experienced are you with this library?
Beginner - Just getting started with this library
Are you interested in working on a PR for this?
- I want to work on this
Metadata
Metadata
Assignees
Labels
Type
Projects
Status