John Dickinson wrote on 02/17/2006 12:09 PM:

Where is the best, or recommended, place to call addShutDownHandler()?

I have an action that may take a while to exit (it polls a queue). However, I do have a function that can be called to force the action to exit. The problem I'm having is restarting the app server. It doesn't want to exit until my action has finished executing. I'd like to add my kill switch function so that when I stop the app server, it doesn't hang until the action exits.

I recommend using contextInitialize. In the __init__.py of any context, you can define the contextInitialize() function to add shutdown handlers. For example:

def contextInitialize(app, contextPath):
   """
       Called by the WebKit Application when the context is loaded
   """
   from somepackage.somemodule import shutdownFunction
   app.addShutDownHandler(shutdownFunction)


Regards - Ben


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to