Ravn::
SocketBroker class
Superclass | Concurrent::Actor::Context |
Constants
- MAX_READ_SIZE
Maximum number of bytes to read in a single operation
Attributes
- interval R
The IO interval (in floating-point seconds)
- io_timer R
The Concurrent::TimerTask that executes the IO loop on an interval
- read_buffer R
The device’s read buffer
- socket R
The socket the broker is managing
- write_buffer R
The device’s write buffer
Public Class Methods
Create a new SocketBroker
that will manage IO for the given socket
, encoding and decoding raw data using TNetstring, and tell
ing its parent about any data read. The IO loop runs at most every interval
seconds.
Public Instance Methods
Use the IO-bound thread pool instead of the default
Do a nonblocking read and write from the socket.
Create a return a Concurrent::TimerTask that will execute the IO loop every
interval seconds.
Actor API – handle actor lifecycle events
.
Actor API – handle incoming +message+s.
Try to decode any data in the read buffer, and publish any resulting objects to the parent.
Read any pending data from the read socket and append it to the read buffer.
Start the broker thread.
Stop the broker.
Write any pending data in the write buffer to the socket.