On Fri, 24 Apr 2009 19:32:11 -0500
johnr <[email protected]> wrote:

> Hello,
> 
> What is the POE way of accessing application configuration across 
> sessions?   I was working with Config::General (storing config info
> in a session's heap).  However, that is not accessible by other
> sessions. What is the approach for dealing with this?
> 
> Thanks,
> 
> John
> 

There are a couple of ways to do that. You could do some dependency
injection on the constructed sessions so that they get their config
info from the parent session. You could by convention, have each
session know that the config information is stored in the parent
session and therefore call $parent->get_heap(). You could have a
lexical hash that is available to all of the sessions. Etc. Etc.

I think you will find a myriad of ways that other people are doing it.
But I believe the dependency injection of configuration information is
the most common.

-- 

Nicholas Perez
XMPP/Email: [email protected]
http://search.cpan.org/~nperez/
http://github.com/nperez

Reply via email to