POE::Stage::App - a base class for POE::Stage applications
#!/usr/bin/env perl
{
package App;
use POE::Stage::App qw(:base);
sub on_run {
print "hello, ", my $arg_whom, "!\n";
}
}
App->new->run( whom => "world" );
exit;
POE::Stage::App is a base class for a POE::Stage-based program's main code. It's
used to bootstrap the initial stage from which messages can be sent, and it
provides an abstract run() method that kicks off the program's main
message dispatch loop.
POE::Stage::App exists to provide a single method: run().
run() instantiates the application, sends a message to its
"on_run" method, and starts the framework's main dispatch loop. The
ARGUMENT_PAIRS given to App->run(...) are passed as parameters to the
application's on_run() method.
run() will not return until the application is finished.
Most examples follow run() with
"exit" as a reminder of this fact.
See <http://thirdlobe.com/projects/poe-stage/report/1> for known issues.
See <http://thirdlobe.com/projects/poe-stage/newticket> to report a
problem.
POE::Stage is the base class for message-driven objects. POE::Request is the
base class for POE::Stage messages. POE::Watcher is the base class for event
watchers.
<http://thirdlobe.com/projects/poe-stage/> - POE::Stage is
hosted here.
Rocco Caputo <rcaputo@cpan.org>.
POE::Stage 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.