mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-07 00:00:58 +00:00
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1423 e7d03fd6-7b0d-0410-9947-9c21f3af8025
25 lines
675 B
Python
25 lines
675 B
Python
# -*- coding: iso-8859-1 -*-
|
|
# sz_fcgi.py - Multithreaded FastCGI Wrapper
|
|
"""Multithreaded FastCGI Wrapper"""
|
|
|
|
import thread
|
|
|
|
import linkcheck.fcgi
|
|
|
|
|
|
class SzFcgi (object):
|
|
"""create threads to handle cgi requests"""
|
|
|
|
def __init__ (self, func):
|
|
"""store function to execute on a request"""
|
|
self.func = func
|
|
|
|
def run (self):
|
|
"""create a new thread to handle requests"""
|
|
try:
|
|
while linkcheck.fcgi.isFCGI():
|
|
req = linkcheck.fcgi.FCGI()
|
|
thread.start_new_thread(self.func, (self, req))
|
|
except:
|
|
import traceback
|
|
traceback.print_exc(file=file('traceback', 'a'))
|