2000-03-08 12:01:51 +00:00
|
|
|
# sz_fcgi.py - Multithreaded FastCGI Wrapper
|
|
|
|
|
__version__ = "v0.8 19/10/1998 ajung"
|
|
|
|
|
__doc__ = "Multithreaded FastCGI Wrapper"
|
|
|
|
|
|
|
|
|
|
|
2002-02-08 18:49:46 +00:00
|
|
|
import thread,fcgi
|
2000-03-08 12:01:51 +00:00
|
|
|
|
|
|
|
|
class SZ_FCGI:
|
2000-03-24 19:00:30 +00:00
|
|
|
def __init__(self,func):
|
|
|
|
|
self.func = func
|
|
|
|
|
|
|
|
|
|
# create a new thread to handle requests
|
|
|
|
|
def run(self):
|
|
|
|
|
try:
|
2000-03-26 18:53:23 +00:00
|
|
|
while fcgi.isFCGI():
|
|
|
|
|
req = fcgi.FCGI()
|
|
|
|
|
thread.start_new_thread(self.func,(self, req))
|
2000-03-24 19:00:30 +00:00
|
|
|
except:
|
2000-03-26 18:53:23 +00:00
|
|
|
import traceback
|
|
|
|
|
traceback.print_exc(file = open('traceback', 'a'))
|