Class Rev::IO
In: lib/rev/io.rb
Parent: Object

A buffered I/O class witch fits into the Rev Watcher framework. It provides both an observer which reads data as it‘s received from the wire and a buffered write watcher which stores data and writes it out each time the socket becomes writable.

This class is primarily meant as a base class for other streams which need non-blocking writing, and is used to implement Rev‘s Socket class and its associated subclasses.


Classes and Modules

Class Rev::IO::Watcher


INPUT_SIZE = 16384   Maximum number of bytes to consume at once

Public Class methods

Public Instance methods

Attach to the event loop

Is the watcher attached?

Close the IO stream

Is the IO object closed?

Detach from the event loop

Disable the watcher

Enable the watcher

Is the watcher enabled?

Obtain the event loop associated with this object

Called whenever the IO object hits EOF

Called whenever the IO object receives data

Called whenever a write completes and the output buffer is empty

Number of bytes are currently in the output buffer

Write data in a buffered, non-blocking manner

Protected Instance methods

Read from the input buffer and dispatch to on_read

Write the contents of the output buffer

Schedule a write to be performed when the IO object becomes writable