Hi there

We have some Pylons apps in which we want to add some custom startup
and some custom shutdown code. The start-up should occur before any
requests start coming and, and the shutdown code should execute when
the app is about to exit.

The question is: what is the best spot for these? (The kind of code I
am talking about is this: we want to have some worker threads running
the whole time the app is running. They should be started early on,
and stay alive, until told to shutdown at program exit)

For startup, I'm thinking of adding something to load_environment.
(Please comment)

For shutdown, I AM BAFFLED.

Im reading a document from the web titled Pylons Execution Analysis
and nothing obvious has jumped out at me, as a good "common exit
point".

As an aisde, I restructured paster-script.py to insert a "print"
before it calls load_entry_point and to insert a "print" just after
the call. (I was just doing this for learning purposes. My "before
print" printed out when I started the app, but when I terminated the
app, my "after message" didn't come out, leaving me to believe that
control never returned from the call to load_entry_point.

Any light anyone can shine on these topics would be great!
Thanks
Michael

-- 
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