Design philosophy of HTTPServer and BaseHTTPRequestHandler
- From: "tzuchien <dot> chiu <at> gmail <dot> com" <tzuchien.chiu@xxxxxxxxx>
- Date: Wed, 22 Aug 2007 02:50:16 -0700
Hello, everyone.
Several instances of a same script, which accepts parameters and does
a lengthy job, are executed on a remote machine. I want to couple the
script with a tiny HTTP server so that I can connect to the machine
with a browser and monitor the progress of jobs. The HTTP server of
each instance will bind to different ports.
A BaseHTTPRequestHandler-derived class must somehow know the
parameters of each instance/job in order to return instance/job-
specific result back to the client in do_GET. However, there is no way
to pass parameters (of the lengthy job) because the constructor of
HTTPServer expects a BaseHTTPRequestHandler-derived "class", instead
of an "object".
I cannot (or should not) dynamically create a "BaseHTTPRequestHandler-
derived "class" for each instance of the script, right?
Do I misunderstand the design philosophy of HTTPServer and
BaseHTTPRequestHandler, and they should not be used in this way?
.
- Follow-Ups:
- Re: Design philosophy of HTTPServer and BaseHTTPRequestHandler
- From: Gabriel Genellina
- Re: Design philosophy of HTTPServer and BaseHTTPRequestHandler
- Prev by Date: Re: Dispatching default application for file, cross platform.
- Next by Date: ActiveX control in python vs ActiveX control in vb 6 (piece of code)
- Previous by thread: non-blocking communication with imaplib
- Next by thread: Re: Design philosophy of HTTPServer and BaseHTTPRequestHandler
- Index(es):
Relevant Pages
|