Inside each thread __init__ you can load your app configuration, here's an
example:

from paste.deploy import appconfig
from my_app.config.environment import load_environment

def __init__(self, ...):
    conf = appconfig('config:' + '/path/to/my/development.ini')
    load_environment(conf.global_conf, conf.local_conf)


Hope that helps.

- Didip -

On Mon, Jun 7, 2010 at 9:23 AM, Brian Morgan <[email protected]>wrote:

> I have a Paste command that correctly sets up the environment and runs
> as expected.  I am trying to make this command a multi-threaded job
> processor.  (i.e. have one main app thread that dispatches work to sub-
> threads).  The problem arises with StackedObjectProxy.  All the pylons
> global variable are not initialized for the new thread I just created
> to do the work.
>
> The question is, how can I do this?  How can I re-initialize the
> environment for each thread that is doing work?  I had been able to
> hack around it pre-1.0, but now more things have been migrated to
> StackedObjectProxy (i.e. pylons.url, after moving from url_for).
>
> Thanks for the help.
>
> -Brian
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<pylons-discuss%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to