• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

bench/H25-Apr-2012-306180

ex/H25-Apr-2012-1,043690

lib/MooseX/H25-Apr-2012-1,405356

t/H25-Apr-2012-967679

ChangesH A D25-Apr-20123.5 KiB10376

LICENSEH A D25-Apr-201218 KiB378292

MANIFESTH A D25-Apr-20121 KiB5352

META.jsonH A D25-Apr-20127.3 KiB259257

META.ymlH A D25-Apr-20124.7 KiB190189

Makefile.PLH A D25-Apr-20121.2 KiB5641

READMEH A D25-Apr-2012364 146

README.mdH A D25-Apr-20125 KiB177121

dist.iniH A D25-Apr-2012714 3830

README

1
2
3This archive contains the distribution MooseX-POE,
4version 0.215:
5
6  The Illicit Love Child of Moose and POE
7
8This software is copyright (c) 2010 by Chris Prather, Ash Berlin, Chris Williams, Yuval Kogman, Torsten Raudssus.
9
10This is free software; you can redistribute it and/or modify it under
11the same terms as the Perl 5 programming language system itself.
12
13
14

README.md

1# NAME
2
3MooseX::POE - The Illicit Love Child of Moose and POE
4
5# VERSION
6
7This document describes MooseX::POE version 0.205
8
9# SYNOPSIS
10
11    package Counter;
12    use MooseX::POE;
13
14    has count => (
15        isa     => 'Int',
16        is      => 'rw',
17        lazy    => 1,
18        default => sub { 0 },
19    );
20
21    sub START {
22        my ($self) = @_;
23        $self->yield('increment');
24    }
25
26    event increment => sub {
27        my ($self) = @_;
28        print "Count is now " . $self->count . "\n";
29        $self->count( $self->count + 1 );
30        $self->yield('increment') unless $self->count > 3;
31    };
32
33    no MooseX::POE;
34
35    Counter->new();
36    POE::Kernel->run();
37
38or with L<MooseX::Declare|MooseX::Declare>:
39
40    class Counter {
41        use MooseX::POE::SweetArgs qw(event);
42
43
44        has count => (
45            isa     => 'Int',
46            is      => 'rw',
47            lazy    => 1,
48            default => sub { 0 },
49        );
50
51
52        sub START {
53            my ($self) = @_;
54            $self->yield('increment')
55        }
56
57
58        event increment => sub {
59            my ($self) = @_;
60            print "Count is now " . $self->count . "\n";
61            $self->count( $self->count + 1 );
62            $self->yield('increment') unless $self->count > 3;
63        }
64    }
65
66    Counter->new();
67    POE::Kernel->run();
68
69# DESCRIPTION
70
71MooseX::POE is a Moose wrapper around a POE::Session.
72
73# KEYWORDS
74
75- event $name $subref
76
77Create an event handler named $name.
78
79# METHODS
80
81Default POE-related methods are provided by L<MooseX::POE::Meta::Trait::Object|MooseX::POE::Meta::Trait::Object>
82which is applied to your base class (which is usually L<Moose::Object|Moose::Object>) when
83you use this module. See that module for the documentation for. Below is a list
84of methods on that class so you know what to look for:
85
86- get_session_id
87
88- yield
89
90- call
91
92- STARTALL
93
94- STOPALL
95
96
97
98# NOTES ON USAGE WITH L<MooseX::Declare|MooseX::Declare>
99
100L<MooseX::Declare|MooseX::Declare> support is still "experimental". Meaning that I don't use it,
101I don't have any code that uses it, and thus I can't adequately say that it
102won't cause monkeys to fly out of any orifices on your body beyond what the
103tests and the SYNOPSIS cover.
104
105That said there are a few caveats that have turned up during testing.
106
1071. The `method` keyword doesn't seem to work as expected. This is an
108integration issue that is being resolved but I want to wait for
109L<MooseX::Declare|MooseX::Declare> to gain some more polish on their slurpy
110arguments.
111
1122. MooseX::POE attempts to re-export L<Moose|Moose>, which
113L<MooseX::Declare|MooseX::Declare> has already exported in a custom fashion.
114This means that you'll get a keyword clash between the features that
115L<MooseX::Declare|MooseX::Declare> handles for you and the features that Moose
116handles. To work around this you'll need to write:
117
118    use MooseX::POE qw(event);
119    # or
120    use MooseX::POE::SweetArgs qw(event);
121    # or
122    use MooseX::POE::Role qw(event);
123
124to keep MooseX::POE from exporting the sugar that
125L<MooseX::Declare|MooseX::Declare> doesn't like. This is fixed in the Git
126version of L<MooseX::Declare|MooseX::Declare> but that version (as of this
127writing) is not on the CPAN.
128
129# DEPENDENCIES
130
131L<Moose|Moose>
132
133L<POE|POE>
134
135# AUTHOR
136
137Chris Prather  `<chris@prather.org>`
138
139Ash Berlin `<ash@cpan.org>`
140
141Chris Williams `<chris@bingosnet.co.uk`>
142
143Yuval (nothingmuch) Kogman
144
145# LICENCE AND COPYRIGHT
146
147Copyright (c) 2007-2009, Chris Prather `<chris@prather.org>`, Ash Berlin
148`<ash@cpan.org>`, Chris Williams `<chris@bingosnet.co.uk`>, Yuval
149(nothingmuch) Kogman. Some rights reserved.
150
151This module is free software; you can redistribute it and/or
152modify it under the same terms as Perl itself. See [perlartistic](http://search.cpan.org/perldoc?perlartistic).
153
154
155
156# DISCLAIMER OF WARRANTY
157
158BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
159FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
160OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
161PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
162EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
163WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
164ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
165YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
166NECESSARY SERVICING, REPAIR, OR CORRECTION.
167
168IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
169WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
170REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
171LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
172OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
173THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
174RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
175FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
176SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
177SUCH DAMAGES.