diff options
author | Allan Saddi <allan@saddi.com> | 2005-05-18 19:59:02 +0000 |
---|---|---|
committer | Allan Saddi <allan@saddi.com> | 2005-05-18 19:59:02 +0000 |
commit | 8f4e536580563b7aadbe71e722c475e81c679b4e (patch) | |
tree | 4993cdccaa2caeb10be5cd5d058a925a69b682e9 /flup/server/scgi_base.py | |
parent | a8a85bf72115f6b84a655ed08872bf74410815a5 (diff) | |
download | flup-8f4e536580563b7aadbe71e722c475e81c679b4e.tar.gz |
Change threaded servers so wsgi.multiprocess is False by default.
Allow it to be changed by keyword argument.
Diffstat (limited to 'flup/server/scgi_base.py')
-rw-r--r-- | flup/server/scgi_base.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/flup/server/scgi_base.py b/flup/server/scgi_base.py index 198f293..8da1c36 100644 --- a/flup/server/scgi_base.py +++ b/flup/server/scgi_base.py @@ -267,13 +267,8 @@ class BaseSCGIServer(object): # What Request class to use. requestClass = Request - # AFAIK, the current mod_scgi does not do load-balancing/fail-over. - # So a single application deployment will only run in one process - # at a time, on this server (when using a threaded server, of course). - _multiprocess = False - def __init__(self, application, scriptName='', environ=None, - multithreaded=True, + multithreaded=True, multiprocess=False, bindAddress=('localhost', 4000), allowedServers=None, loggingLevel=logging.INFO): """ @@ -287,6 +282,9 @@ class BaseSCGIServer(object): Set multithreaded to False if your application is not thread-safe. + Set multiprocess to True to explicitly set wsgi.multiprocess to + True. (Only makes sense with threaded servers.) + bindAddress is the address to bind to, which must be a tuple of length 2. The first element is a string, which is the host name or IPv4 address of a local interface. The 2nd element is the port @@ -305,6 +303,7 @@ class BaseSCGIServer(object): self.scriptName = scriptName self.environ = environ self.multithreaded = multithreaded + self.multiprocess = multiprocess self._bindAddress = bindAddress self._allowedServers = allowedServers @@ -345,7 +344,7 @@ class BaseSCGIServer(object): environ['wsgi.input'] = request.stdin environ['wsgi.errors'] = sys.stderr environ['wsgi.multithread'] = self.multithreaded - environ['wsgi.multiprocess'] = self._multiprocess + environ['wsgi.multiprocess'] = self.multiprocess environ['wsgi.run_once'] = False if environ.get('HTTPS', 'off') in ('on', '1'): |