Class: Protocol::Rack::Body::Streaming::Output
- Inherits:
-
Object
- Object
- Protocol::Rack::Body::Streaming::Output
- Defined in:
- lib/protocol/rack/body/streaming.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(input, block) ⇒ Output
constructor
A new instance of Output.
- #read ⇒ Object
- #write(chunk) ⇒ Object
Constructor Details
Instance Method Details
#close ⇒ Object
35 36 37 |
# File 'lib/protocol/rack/body/streaming.rb', line 35 def close @fiber = nil end |
#read ⇒ Object
39 40 41 |
# File 'lib/protocol/rack/body/streaming.rb', line 39 def read @fiber&.resume end |
#write(chunk) ⇒ Object
31 32 33 |
# File 'lib/protocol/rack/body/streaming.rb', line 31 def write(chunk) Fiber.yield(chunk) end |