reactor/reactor |
class Reactor < Object |
class AlreadyRegistered < RuntimeError |
class NotRegistered < RuntimeError |
Public Methods |
Register callback whenever data is ready to be read on io_object. The implementation should throw AlreadyRegistered if there is already a callback registered for this io_object.
io_object | the io object to register for. |
---|---|
callback | a proc or method that gets called when data is ready. |
Register callback whenever data is ready to be written to io_object. The implementation should throw AlreadyRegistered if there is already a callback registered for this io_object.
io_object | the io object to register for. |
---|---|
callback | a proc or method that gets called when the io_object is ready to be written to. |
Register callback whenever an exceptional conditions occurs for io_object. The implementation should throw AlreadyRegistered if there is already a callback registered for this io_object.
io_object | the io object to register for. |
---|---|
callback | a proc or method that gets called when the io_object has an exceptional condition. |
Unregister a read handler for an io_object. The implementation should raise NotRegistered if there is no callback registered for this io_object.
io_object | the io object to unregister. |
---|
Unregister a write handler for an io_object. The implementation should raise NotRegistered if there is no callback registered for this io_object.
io_object | the io object to unregister. |
---|
Unregister an error handler for an io_object. The implementation should raise NotRegistered if there is no callback registered for this io_object.
io_object | the io object to unregister. |
---|
Run the reactor event loop for t seconds (or indefinitely if t is nil).
t | the length of time to run the event loop. |
---|
End the reactor event loop.
Determine if there the reactor has work to be done.
Returns: true if there is work pending, or false otherwise.
Schedule a timer event.
callback | a proc or method to be called whenever the timer goes off. |
---|---|
delta | the amount of time to wait before the first timer goes off. |
interval | the amount of time to wait between intervals. |
Returns: the id of a timer event.
Unregister a timer event.
timerid | the id of the timer event to unregister. |
---|