> -----Original Message----- > From: Rocco Caputo [mailto:[EMAIL PROTECTED] > Sent: Monday, September 22, 2003 2:45 PM > To: '[EMAIL PROTECTED]' > Subject: Re: Session state registration > > > On Mon, Sep 22, 2003 at 02:35:05PM -0500, Alan Hastings wrote: > > I have long-lived sessions that (may) want to add or remove states after the > > session is created... the session object has a register_state method that is > > not documented, but looks functional if you peek under the covers. I > > thought I would check before wandering into this minefield... it looks like > > it would be ok to add or remove states, since it appears the SE_STATES hash > > is used in a "stateless" (har!) manner. Any problems with removing states > > from the hash? > > > > I have other ways to do the job (it *is* perl, after all) but this might be > > cleaner. > > > > Thanks for any insight -- > > Session's register_state() method is quasi-public. It's got a public > name (no leading underscore), but it's not documented. Rather, it's > published through Kernel's state() method, which acts on "the current > session". That's documented in POE::Kernel. > > This is encapsulation through obfuscation. :)
It's almost there... The kernel->state() method has no provision for removing a state, as far as I can tell. In fact it takes pains to assure that the handler is set before calling the session->register_state(). Is that because there are issues with removing active states? Alan > > -- > Rocco Caputo - [EMAIL PROTECTED] - http://poe.perl.org/ >
