Class: Tep::Stream
- Inherits:
-
Object
- Object
- Tep::Stream
- Defined in:
- lib/tep/streamer.rb
Overview
Per-request handle the user’s ‘pump` writes to. Wraps the client fd so each `out.write(s)` becomes one chunked frame.
Instance Attribute Summary collapse
-
#fd ⇒ Object
Returns the value of attribute fd.
Instance Method Summary collapse
-
#initialize(fd) ⇒ Stream
constructor
A new instance of Stream.
- #write(s) ⇒ Object
Constructor Details
#initialize(fd) ⇒ Stream
Returns a new instance of Stream.
22 23 24 |
# File 'lib/tep/streamer.rb', line 22 def initialize(fd) @fd = fd end |
Instance Attribute Details
#fd ⇒ Object
Returns the value of attribute fd.
20 21 22 |
# File 'lib/tep/streamer.rb', line 20 def fd @fd end |
Instance Method Details
#write(s) ⇒ Object
26 27 28 29 |
# File 'lib/tep/streamer.rb', line 26 def write(s) Sock.sphttp_write_chunk(@fd, s) 0 end |