POE::Declare::Meta::Timeout - A named timeout with generated support methods
# Send a request sub request : Event { $_[SELF]->request_timeout_start; $_[SELF]->{handle}->put('something'); } # Recieved a response sub response : Event { if ( $_[ARG0] eq 'keepalive' ) { $_[SELF]->request_timeout_restart; return; } $_[SELF]->request_timeout_stop; $_[SELF]->{parent}->post('child_response', $_[ARG0]); } # Did not get a response sub request_timeout : Timeout(30) { # Take some action $_[SELF]->cleanup; $_[SELF]->{parent}->post('child_response', 'timeout'); }
POE::Declare::Meta::Timeout is a sub-class of Event with access to a number of additional methods relating to timers and alarms.
Event
Bugs should be always be reported via the CPAN bug tracker at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=POE-Declare
For other issues, or commercial enhancement or support, contact the author.
Adam Kennedy <adamk@cpan.org>
POE, POE::Declare
Copyright 2006 - 2010 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
To install POE::Declare, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Declare
CPAN shell
perl -MCPAN -e shell install POE::Declare
For more information on module installation, please visit the detailed CPAN module installation guide.