POE::Kernel 0.3502 review

Download
by rbytes.net on

POE::Kernel is an event driven threaded application kernel in Perl. SYNOPSIS POE comes with its own event loop, which is based

License: Perl Artistic License
File size: 0K
Developer: Rocco Caputo
0 stars award from rbytes.net

POE::Kernel is an event driven threaded application kernel in Perl.

SYNOPSIS

POE comes with its own event loop, which is based on select() and written entirely in Perl. To use it, simply:

use POE;

POE can adapt itself to work with other event loops and I/O multiplex systems. Currently it adapts to Gtk, Tk, Event.pm, or IO::Poll when one of those modules is used before POE::Kernel.

use Gtk; # Or Tk, Event, or IO::Poll;
use POE;

or

use POE qw(Loop::Gtk);

or

use POE::Kernel { loop => "Gtk" };
use POE::Session;

Methods to manage the process' global Kernel instance:

# Retrieve the kernel's unique identifier.
$kernel_id = $kernel->ID;

# Run the event loop, only returning when it has no more sessions to
# dispatch events to. Supports two forms.
$poe_kernel->run();
POE::Kernel->run();

FIFO event methods:

# Post an event to an arbitrary session.
$kernel->post( $session, $event, @event_args );

# Post an event back to the current session.
$kernel->yield( $event, @event_args );

# Call an event handler synchronously. Bypasses POE's event queue
# and returns the handler's return value.
$handler_result = $kernel->call( $session, $event, @event_args );

Original alarm and delay methods:

# Post an event which will be delivered at a given Unix epoch time.
# This clears previous timed events with the same state name.
$kernel->alarm( $event, $epoch_time, @event_args );

# Post an additional alarm, leaving existing ones in the queue.
$kernel->alarm_add( $event, $epoch_time, @event_args );

# Post an event which will be delivered after a delay, specified in
# seconds hence. This clears previous timed events with the same
# name.
$kernel->delay( $event, $seconds, @event_args );

# Post an additional delay, leaving existing ones in the queue.
$kernel->delay_add( $event, $seconds, @event_args );

Requirements:
Perl

POE::Kernel 0.3502 search tags