Class: EventMachine::FileStreamer
- Inherits:
-
Object
- Object
- EventMachine::FileStreamer
- Includes:
- Deferrable
- Defined in:
- lib/em/streamer.rb
Overview
Streams a file over a given connection. Streaming begins once the object is instantiated. Typically FileStreamer instances are not reused.
Streaming uses buffering for files larger than 16K and uses so-called fast file reader (a C++ extension) if available (it is part of eventmachine gem itself).
Constant Summary
- MappingThreshold =
Use mapped streamer for files bigger than 16k
16384- BackpressureLevel =
Wait until next tick to send more data when 50k is still in the outgoing buffer
50000- ChunkSize =
Send 16k chunks at a time
16384
Instance Method Summary (collapse)
-
- (FileStreamer) initialize(connection, filename, args = {})
constructor
A new instance of FileStreamer.
Methods included from Deferrable
#callback, #cancel_callback, #cancel_errback, #cancel_timeout, #errback, #fail, future, #set_deferred_status, #succeed, #timeout
Constructor Details
- (FileStreamer) initialize(connection, filename, args = {})
A new instance of FileStreamer
36 |
# File 'lib/em/streamer.rb', line 36 def initialize connection, filename, args = {} |