Re: object_states 2
by Tavin Cole other posts by this author
Nov 20 2006 12:48PM messages near this date
Re: object_states 2
|
object_states
lanas wrote:
> POE::Session->create
> (
> object_states =>
> [
> $obj_a => ['method1', 'method2'],
> $obj_b => ['method1', 'method2'],
> ],
>
> inline_states =>
> {
> _start => \&startIt,
> },
> );
>
> sub startIt
> {
> print "Started !\n";
> $_[KERNEL]->alias_set("os");
> $_[KERNEL]->post('os', 'method2');
> }
>
> method2() of obj_b gets called. How to specify obj_a ?
with the object_states syntax you use, you are defining two events in
your session, 'method1' and 'method2', and then redefining the same two
events.. the first definition is forgotten.
so you need to use a different event name for $obj_a
-tavin
Thread:
Lanas
Matt Sickler
Tavin Cole
|