Stem::Event::Plain::new

This event is queued up for dispatch in the future when there no other pending events. It has these attributes which are passed into the new constructor:

'object' => <required object to trigger>
'method' => <method to call (default is 'triggered')>

Example

        $plain_event = Stem::Event::Plain->new( 'object' => $foo_obj ) ;

Stem::Event::Signal::new

This event is triggered by signals. It has these attributes which are passed into the new constructor:

'object' => <required object to trigger>
'method' => <method to call (default is 'SIG_handler')> where SIG is the lower case name of the signal
'signal' => <name of signal>

Example

        $signal_event = Stem::Event::Signal->new( 'object' => $foo_obj
                                                  'signal' => 'INT' ) ;

        sub sigint_handler { die "SIGINT\n" }

Stem::Event::Timer::new

This event is queued up for dispatch in the future at a given time ('at') or after a minimum time period has elapsed ('delay'). One of the two time attributes 'at' or 'delay' must be set. Here are the allowed attributes:

'object' => <required object to trigger>
'at' => <epoch time when to trigger event>
'delay' => <time in seconds to wait before triggering event>
'method' => <method to call (default is 'timed_out')>
'interval' => <interval in seconds before retriggers>
'hard' => interval timer starts at start of callback
'single' => single shot timer

Stem::Event::Read::new

This event is triggered whenever its file descriptor has data to be read. It takes an optional timeout value which will trigger the read_timeout method if no data has come in during that period.

            'object'        => <required object to trigger>
    
            'fh'            => <required file descriptor to watch for reading>
    
    
            'method'        => <method to call - default is 'readable'>
    
            'timeout_method' =>
                    <method to call when timed out (default is 'read_timeout')>
    
    
            'timeout'       =>
                    <timeout in seconds to wait on a read (default is no timeout)>

Stem::Event::Write::new

This event is triggered whenever its file descriptor can be written to. It takes an optional timeout value which will trigger the write_timeout method if no data be written during that period. Write events are stopped when created - a call to the start method is needed to activate them.

            'object'        => <required object to trigger>
    
            'fh'            => <required file descriptor to watch for writing>
    
    
            'method'        => <method to call - default is 'writeable'>
    
            'timeout_method' =>
                    <method to call when timed out (default is 'write_timeout')>
    
    
            'timeout'       =>
                    <timeout in seconds to wait on a write (default is no timeout)>