IO::Lambda::Loop::Select - select(2)-based event loop for IO::Lambda
This is the default implementation of event loop for IO::Lambda. IO::Lambda is designed to be agnostic of event loop choice, but this one is the default, reference implementation. The module is not intended for direct use. The documentation declares the event loop interface rather than explains specificities of the module.
use IO::Lambda::Loop::Select; # explicitly select the event loop module use IO::Lambda;
Creates new instance of IO::Lambda::Loop::Select.
Stores the timeout record. The timeout record is an array, with the following
layout: [ $OBJECT, $DEADLINE, $CALLBACK ]. Loop will invoke
IO::Lambda::io_handler on $OBJECT after $DEADLINE is expired.
Returns TRUE if there are no records in the loop, FALSE otherwise.
Removes all records associated with $OBJECT.
Removes a single event record.
Stores the IO record. The IO record in an array, with the following
layout: [ $OBJECT, $DEADLINE, $CALLBACK, $HANDLE, $FLAGS ]. Loop will
invoke IO::Lambda::io_handler on $OBJECT either when $HANDLE
becomes readable/writable etc, depending on $FLAGS, or after $DEADLINE
is expired. $DEADLINE can be undef, meaning no timeout. $FLAGS is
a combination of IO_READ, IO_WRITE, and IO_EXCEPTION values.
Waits for at least one of the stored record to become active, dispatches
events to IO::Lambda::io_handler for the records that have, then removes
these records. The invoker must resubmit records in order continue receiving
new events.