Creating your own WSGI server and call start() and stop() on it,
instead of using app.run(). Have a look at runsimple() in
httpserver.py (part of web.py). Skeleton code:

app = web.application(urls, globals())
wsgifunc = app.wsgifunc()
wsgifunc = web.httpserver.StaticMiddleware(wsgifunc)  ## Enable /
static
webserver = web.httpserver.WSGIServer(address, wsgifunc)
webserver.start()

Then to shut it down do a webserver.stop()


Dave


On Jun 23, 3:49 pm, Graham Dumpleton <[email protected]>
wrote:
> On Jun 23, 11:10 am, Anand Chitipothu <[email protected]> wrote:
>
> > 2010/6/23 elpanson <[email protected]>:
>
> > > I am using embedded python and using web.py as a lightweight web
> > > server. I need a way to signal it to shutdown, my application is a
> > > Windows Service and does not have Keyboard interrupts.
>
> > Did you try calling sys.exit()?
>
> Usually that would not work in an embedded system as all it does is
> throw a SystemExit exception. It would need the C code which calls
> into the Python code to detect that type of exception and call C
> exit() function or otherwise shutdown the process in an orderly
> manner.
>
> Graham

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en.

Reply via email to