Class: Braintrust::Server::SSEBody
- Inherits:
-
Object
- Object
- Braintrust::Server::SSEBody
- Defined in:
- lib/braintrust/server/sse.rb
Overview
Rack-compatible response body that streams SSE events via ‘each`.
Works with Puma (immediate writes), Passenger, and rack-test. WEBrick buffers the entire body and is unsuitable for SSE.
Falcon buffers ‘each`-based bodies as Enumerable; use SSEStreamBody instead.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(&block) ⇒ SSEBody
constructor
A new instance of SSEBody.
Constructor Details
#initialize(&block) ⇒ SSEBody
Returns a new instance of SSEBody.
12 13 14 |
# File 'lib/braintrust/server/sse.rb', line 12 def initialize(&block) @block = block end |