# HG changeset patch # User Tero Marttila # Date 1234632179 -7200 # Node ID 4be5aebe0472d47d04735e6afc7ffcd5e5a2ecd9 # Parent d2ce81dd5e5d244753fd8a0d3e1d920dbecd769a FastCGI support using flup (ugh, threads) diff -r d2ce81dd5e5d -r 4be5aebe0472 fastcgi_main.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fastcgi_main.py Sat Feb 14 19:22:59 2009 +0200 @@ -0,0 +1,39 @@ +#!/usr/bin/python2.5 + +""" + WSGI FastCGI support using flup (grr, threads). + + Currently, this uses flup.server.fcgi, but it attempts to batten down the hatches against the evil that is + *threads* :) +""" + +import flup.server.fcgi + +def run (app, bind=None) : + """ + Run as a non-threaded single-process non-multiplexed FastCGI server + """ + + # create WSGIServer + server = flup.server.fcgi.WSGIServer(app, + # try to supress threading + multithreaded=False, + multiprocess=False, + multiplexed=False, + + # specify the bind() address + bindAddress=bind, + + # leave as defaults for now + umask=None, + + # XXX: non-debug mode? + debug=True, + ) + + import sys + sys.stderr.write("qmsk.web.fastcgi: run\n") + + # run... threads :( + server.run() +