2008年9月12日金曜日

裏番組

このエントリーをブックマークに追加 このエントリーを含むはてなブックマーク
あーゆー雰囲気はなんかはかどるんですよね~~。

裏番組
cherrypyを読む
body = cherrypy.response.body[0]
の謎を解こう。
from threading import local
で、

request = _ThreadLocalProxy('request')
・・・
def __getattr__(self, name):
childobject = getattr(serving, self.__attrname__)
return getattr(childobject, name)
アクセスはすべてリダイレクト。

じゃあ、いつthreadが作られて、dispatchされるのか?

_cpwsgiserver.py
にある。
class CherryPyWSGIServer(object):

class WorkerThread(threading.Thread):

で、これらが
RequestHandlerClass = HTTPRequest
がQueueに積まれたときに処理を行う。

WorkerThreadのなかで
response = request.wsgi_app(request.environ,
request.start_response)
としているところで、userが書いたappが実行される。
self.mount_points = wsgi_app
はなんなのか?

wsgiの仕様 ( ja ) をよめばいいのかな?

0 件のコメント: