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

MooX::POE - POE::Session combined with Moo (or Moose, if you want)

VERSION

version 0.002

SYNOPSIS

package Counter;

use Moo;
with qw( MooX::POE );

has count => (
  is => 'rw',
  lazy_build => 1,
  default => sub { 1 },
);

sub START {
  my ($self) = @_;
  $self->yield('increment');
}

sub on_increment {
  my ( $self ) = @_;
  print "Count is now " . $self->count . "\n";
  $self->count( $self->count + 1 );
  $self->yield('increment') unless $self->count > 3;
}

Counter->new();
POE::Kernel->run();

DESCRIPTION

This role adds a POE::Session and event handling to the class. Can also be used the same way with Moose.

BASED ON

This plugin is based on code of MooseX::POE.

SUPPORT

IRC

Join #poe on irc.perl.org. Highlight Getty for fast reaction :).

Repository

http://github.com/Getty/p5-moox-poe
Pull request and additional contributors are welcome

Issue Tracker

http://github.com/Getty/p5-moox-poe

AUTHOR

Torsten Raudssus <torsten@raudss.us>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Torsten Raudssus.

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