Class: Tep::Stream

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#fdObject

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