On Fri, 09 Jun 2006 11:15:53 -0400  Apocalypse wrote:
 +------------------
 | Chris Fedde wrote:
 | > On Fri, 09 Jun 2006 15:10:48 +0100  Nick Williams wrote:
 | >  +------------------
 | >  | I never knew about POE::Devel::Profiler and I'm learning rapidly about 
 | >  | it now with my own visualizer. Most cool. However it highlights 
 | >  | something I've wanted for a while: names on sessions. I'm just referrin
g 
 | >  | to something symbolic that can be attached to sessions in order to work
 
 | >  | out in debuggers/profilers what's going on instead of session ID's like
 
 | >  | '4822813', but without the side-effects that aliases have. Is there a 
 | >  | way of doing this? If not, could it be in an enhancement request?
 | >  +------------------
 | >
 | > >From POE::Kernel
 | >
 | >     # Set an alias for the current session.
 | >     $status = $kernel->alias_set( $alias );
 | >
 | > See also the section titled
 | >
 | >     "Numeric Session IDs and Symbolic Session Names (Aliases)"
 | >
 | > I guess that it's a bit odd that it's a Kernel method until you realize
 | > where the info about an alias needs to go
 | >
 | > --
 | > Chris Fedde
 | >
 | >   
 | The side-effects Nick was talking about is that aliases will make the 
 | session live indefinitely, and I'm sure that will screw up a lot of 
 | programs out there :(
 | 
 | Nick, I believe you can make a rfc for something like 
 | $session->label_sess( "foo" );
 | 
 | I don't think that will be a disruptive change, and somebody could 
 | implement it quickly...
 +------------------

I did overlook that "but without the side-effects that aliases" phrase.
I'm sorry about that. 

I wonder if just stuffing some value in the heap would be good enough.  

I'm also a bit confused about how it would be used.  For example a POE program
may have a large number of sessions either all at once or in some complex
sequence.  Automaticaly assigning unique names to each session would be little
better than using numbers.  

It seems to me that the logic for deciding when to call
$session->label_sess( "foo" ); and the logic for dealing with an
alias at birth and death of a session have roughly the same complexity.

As always I'm probably overlooking something else that is obvious.

--
    Chris Fedde

Reply via email to