Class: EventMachine::IOStreamer
- Inherits:
-
Object
- Object
- EventMachine::IOStreamer
- Includes:
- Deferrable
- Defined in:
- lib/em/io_streamer.rb
Constant Summary collapse
- CHUNK_SIZE =
16384
Constants included from Deferrable
Instance Method Summary collapse
-
#initialize(connection, io, opts = {}) ⇒ IOStreamer
constructor
A new instance of IOStreamer.
Methods included from Deferrable
#callback, #cancel_callback, #cancel_errback, #cancel_timeout, #errback, #fail, future, #set_deferred_status, #succeed, #timeout
Constructor Details
#initialize(connection, io, opts = {}) ⇒ IOStreamer
Returns a new instance of IOStreamer.
33 34 35 36 37 38 39 40 41 |
# File 'lib/em/io_streamer.rb', line 33 def initialize(connection, io, opts = {}) @connection = connection @io = io @http_chunks = opts[:http_chunks] @buff = String.new @io.binmode if @io.respond_to?(:binmode) stream_one_chunk end |