The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

POE::Session::AttributeBased - POE::Session syntax sweetener

VERSION

Version 0.06

SYNOPSIS

    #!perl

    package Foo;

    use Test::More tests => 7;

    use POE;
    use base 'POE::Session::AttributeBased';

    sub _start : State {
        my $k : KERNEL;
        my $h : HEAP;

        ok( 1, "in _start" );

        $k->yield( tick => 5 );
    }

    sub tick : State {
        my $k     : KERNEL;
        my $count : ARG0;

        ok( 1, "in tick" );
        return 0 unless $count;

        $k->yield( tick => $count - 1 );
        return 1;
    }

    POE::Session->create(
        Foo->inline_states(),
    );

    POE::Kernel->run();
    exit;

ABSTRACT

A simple mixin that sprinkles sugar all over event handlers.

DESCRIPTION

Provides an attribute handler that does some bookkeeping for state handlers. There have been a few of these classes for POE. This is probably the most minimal.

FUNCTIONS

State

The state hander attribute. Never called directly.

Offset

POE::Session Offsets each have their own packet of sugar

OBJECT =head2 SESSION =head2 KERNEL =head2 HEAP =head2 STATE =head2 SENDER =head2 CALLER_FILE =head2 CALLER_LINE =head2 CALLER_STATE =head2 ARG0 =head2 ARG1 =head2 ARG2 =head2 ARG3 =head2 ARG4 =head2 ARG5 =head2 ARG6 =head2 ARG7 =head2 ARG8 =head2 ARG9

inline_states

Returns the list of states in a syntax that is usable by POE::Session->create. Can also specify what to return as the hash key so that it is useful in packages like POE::Component::Server::TCP where the state list has a different tag.

AUTHOR

Chris Fedde, <cfedde at cpan.org>

BUGS

Please report any bugs or feature requests to bug-poe-attr at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=POE-Session-AttributeBased. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc POE::Session::AttributeBased

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2007 Chris Fedde, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.