Class: EventMachine::FileStreamer
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
self,
Deferrable
|
|
Inherits: | Object |
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
-
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
-
MappingThreshold =
Use mapped streamer for files bigger than 16k
16384
Deferrable
- Included
Class Method Summary
Instance Method Summary
-
#stream_one_chunk
Internal use only
Internal use only
Used internally to stream one chunk at a time over multiple reactor ticks.
-
#ensure_mapping_extension_is_present
private
Internal use only
Internal use only
We use an outboard extension class to get memory-mapped files.
- #stream_with_mapping(filename) private Internal use only Internal use only
- #stream_without_mapping(filename) private Internal use only Internal use only
Deferrable
- Included
#callback | Specify a block to be executed if and when the |
#cancel_callback | Cancels an outstanding callback to &block if any. |
#cancel_errback | Cancels an outstanding errback to &block if any. |
#cancel_timeout | Cancels an outstanding timeout if any. |
#errback | Specify a block to be executed if and when the |
#fail | Sugar for set_deferred_status(:failed, ...). |
#set_deferred_failure | Alias for Deferrable#fail. |
#set_deferred_status | Sets the "disposition" (status) of the |
#set_deferred_success | Alias for Deferrable#succeed. |
#succeed | Sugar for set_deferred_status(:succeeded, ...). |
#timeout | Setting a timeout on a |