GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
POE::Watcher::Delay(3) User Contributed Perl Documentation POE::Watcher::Delay(3)

POE::Watcher::Delay - wait for a length of time to pass

        # Note, this is not a complete program.
        # See the distribution's examples directory.

        # Request a delay notification.
        my $watcher :Req = POE::Watcher::Delay->new(
                seconds     => 10,            # wait 10 seconds, then
                on_success  => "time_is_up",  # call $self->time_is_up()
                args        => {
                        param_1   => 123,           # with $args->{param_1}
                        param_2   => "abc",         # and $args->{param_2}
                },
        );

        # Handle the delay notification.
        sub time_is_up {
                my ($self, $args) = @_;
                print "$args->{param_1}\n";   # 123
                print "$args->{param_2}\n";   # abc
                my $watcher :Req = undef;     # Destroy the watcher.
        }

A POE::Watcher::Delay object waits a certain amount of time before invoking a method on the current Stage object. Both the time to wait and the method to invoke are given as constructor parameters. Parameters included in the "args" hash are passed unchanged to the desired callback method after the specified time has elapsed.

These methods are invoked directly on the watcher object.

Construct a new POE::Watcher::Delay object. The constructor takes two parameters: "seconds" is the number of seconds to wait. "on_success" is the name of the mothod in the current Stage to invoke when length seconds have elapsed.

Like every other watcher object, this one must be saved in order to remain active. Destroy this object to cancel it.

See <http://thirdlobe.com/projects/poe-stage/report/1> for known issues. See <http://thirdlobe.com/projects/poe-stage/newticket> to report one.

POE::Stage is too young for production use. For example, its syntax is still changing. You probably know what you don't like, or what you need that isn't included, so consider fixing or adding that, or at least discussing it with the people on POE's mailing list or IRC channel. Your feedback and contributions will bring POE::Stage closer to usability. We appreciate it.

POE::Watcher describes concepts that are common to all POE::Watcher classes. It's required reading if you want to fully understand what's going on.

Rocco Caputo <rcaputo@cpan.org>.

POE::Watcher::Delay is Copyright 2005-2006 by Rocco Caputo. All rights are reserved. You may use, modify, and/or distribute this module under the same terms as Perl itself.
2008-12-05 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.