MooseX...Object(3pm)
π MooseX::POE::Meta::Trait::Object π
okay bestie, so this is the MooseX...Object(3pm) page β the manual for MooseX::POE::Meta::Trait::Object, the base class role for MooseX::POE. it's giving glue-code-that-holds-your-whole-session-together, and honestly? iconic.
β¨ VERSION β¨
version 0.215 π
πΈ SYNOPSIS πΈ
package Counter;
use MooseX::Poe;
has name => (
isa => 'Str',
is => 'rw',
default => sub { 'Foo ' },
);
has count => (
isa => 'Int',
is => 'rw',
lazy => 1,
default => sub { 0 },
);
sub START {
my ($self) = @_;
$self->yield('increment');
}
sub increment {
my ($self) = @_;
$self->count( $self->count + 1 );
$self->yield('increment') unless $self->count > 3;
}
no MooseX::Poe;
like. look at it. it's a whole little counter and it just works. π
π¦ DESCRIPTION π¦
so MooseX::POE::Meta::TraitObject is a role β and the way that works is it gets applied to the object base classe (usually Moose::Object) that implements a POE::Session. that's the whole vibe. it's the little trait that makes your Moose object actually be a POE session. no cap. π«Ά
π METHODS π
get_session_id
gets you the internal POE Session ID. this is highkey useful to hand off to other POE aware functions. like here, take my ID, go be a session about it. π
yield / call / delay / alarm / alarm_add / delay_add / alarm_set / alarm_adjust / alarm_remove / alarm_remove_all / delay_set / delay_adjust
a cheap alias for the same POE::Kernel function β except this one will gurantee posting to the object's session. (yes, that's the original spelling, we keep it exactly, we do not fix, we do not touch, it's part of the lore now π)
so basically: same function name you already know from POE::Kernel, but it's guaranteed to land in your object's session. obsessed.
STARTALL
along similar lines to Moose's BUILDALL method β which calls all the BUILD methods β this function will call all the START methods in your inheritance hierarchy automatically when POE first runs your session. β¨
(this corresponds to the _start event from POE.)
so you don't gotta manually go find every START up the chain, it just does the whole ancestry for you. main character energy fr fr.
STOPALL
along similar lines to STARTALL, but for STOP instead. π
START
STOP
DEFAULT
CHILD
PARENT
π DEFAULT METHODS π
(no extra deets in the original β this is just the section header, so it stays a header, bestie. we don't invent facts in this house π)
β PREDEFINED EVENTS β
(also just a header in the original. nothing more. periodt.)
π AUTHORS π
- Chris Prather <chris@prather.org>
- Ash Berlin <ash@cpan.org>
- Chris Williams <chris@bingosnet.co.uk>
- Yuval (nothingmuch) Kogman
- Torsten Raudssus <torsten@raudssus.de> <http://www.raudssus.de/>
the whole friend group showed up to write this and we love that for them π₯Ήπ
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2010 by Chris Prather, Ash Berlin, Chris Williams, Yuval Kogman, 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. slay. legal AND free. π
lowkey reminder bestie:MooseX::POE::Meta::Trait::Objectis the role,MooseX::POEis the thing youuse, andno MooseX::Poe;cleans up after you. don't forget the cleanup, it's the skincare routine of Perl π§
okay that's the whole page!! π this was documented by the perl crew, perl v5.26.1, dated 2018-03-30 β and that's the footer, so like, that's a wrap. bye bestie, go build a session π¦β¨
π¦ where this page comes from
- debian bookworm: libmoosex-poe-perl 0.215-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmoosex-poe-perl 0.215-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libmoosex-poe-perl 0.215-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmoosex-poe-perl 0.215-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms