ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-poe
perl-poe
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved