ATTRIBUTES

Event, Event(list,of,names)

Specify that this subroutine will act as an event. In the first form, the name of the subroutine itself is the event name. In the second form, the function will be the target of all the listed events (but not the function name itself, unless it is also included in the list).

:Event may be specified multiple times

Recurring(Interval => $seconds, [Name => 'event_name;])

Specify that this is a recurring timer. It will be called every Interval until the session terminates, or the timer is manually removed (using the POE::Kernel::delay) method.

A new event will be added which will default to the subroutine name. If you wish to use different name, add the Name key with the preferred event name as the value.

Internally, the function is wrapped around with code which looks like this:

$poe_kernel->delay($evname, $interval);
goto &{$symname};

If during execution there is need to remove the event, you can do something like

SigHandler(SIGNAL,LIST)

This function will act as a signal handler for those signals specified in the signal list. Each signal in the list is a signal name recognized by POE. See POE::Kernel for more information on the signals and the arguments they take

POE::Sugar::Attributes->inline_states(pkgname, [alias])

The pkgname and alias parameters have the same semantics as in the previous functions.

RATIONALE

POE itself is quite light in terms of the syntactic sugar it provides. There are some nice wrappers, such as MooseX::POE and POE::Declare, but they provide a heavier layer of abstraction.

This module was intended so that one can keep the same calling and argument conventions of POE itself, while trying to avoid boilerplate for common tasks.

Another possibility with this module, that really does not exist with alternatives, is the ease of maintaining 'mixins'. Mixins are modules which reside outside of the main session, but are logically part of it - and do not need the management overhead of creating a new session.

SEE ALSO

There are quite a few modules out there which have intended to something similar but are either incomplete, too basic, or require much more baggage