On Thu, Oct 28, 2010 at 00:25, Fabio Mascarenhas <mascaren...@acm.org> wrote: > On Wed, Oct 27, 2010 at 5:48 PM, Alexander Gladysh <aglad...@gmail.com> wrote: >>>> I'm running a single-handler wsapi site with
>>>> wsapi.fastcgi.run(function(...) >>>> -- do something >>>> end) >>>> Now I want to be able to shutdown gracefully. >>>> Can I tell something to wsapi so it will just exit its loop? >>> Right now there is no way to do that, sorry... >> I see. Is it hard to add a way to do this? > Not really, I would just need a "please exit" WSAPI response, and, in > wsapi.fastcgi's case, this would make it close the lfcgi pipe and exit > the accept loop. But the probem would be making sure your web server > is honoring that, some servers would just respawn the process on the > next request... If process is respawned it is perfectly OK by me. In fact, that is what I want (and ensuring by using runit) :-) > For fastcgi, PA's suggestion of os.exit is actually quite good, as it > would not leak any resources. But it would leak resources -- os.exit() does not call any __gc handlers. If I have any non-trivial collection code in them, that code would not get executed. Alexander. _______________________________________________ Kepler-Project mailing list Kepler-Project@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project http://www.keplerproject.org/