Class: ClaudeAgentServer::Services::SseStream::StreamBody
- Inherits:
-
Object
- Object
- ClaudeAgentServer::Services::SseStream::StreamBody
- Defined in:
- lib/claude_agent_server/services/sse_stream.rb
Overview
Rack 3 streaming body that yields chunks via a fiber
Instance Method Summary collapse
- #each(&chunk_block) ⇒ Object
-
#initialize(&block) ⇒ StreamBody
constructor
A new instance of StreamBody.
Constructor Details
#initialize(&block) ⇒ StreamBody
Returns a new instance of StreamBody.
50 51 52 |
# File 'lib/claude_agent_server/services/sse_stream.rb', line 50 def initialize(&block) @block = block end |
Instance Method Details
#each(&chunk_block) ⇒ Object
54 55 56 57 |
# File 'lib/claude_agent_server/services/sse_stream.rb', line 54 def each(&chunk_block) stream = StreamWriter.new(chunk_block) @block.call(stream) end |