Package wtf :: Package opi :: Package worker :: Module threaded :: Class ThreadPool
[hide private]
[frames] | no frames]

Class ThreadPool

source code

object --+
         |
        ThreadPool

Dynamic threadpool implementation
Instance Methods [hide private]
 
__init__(self, workerchild, reload_checker, impl, app)
Initialization
source code
 
run(self)
Run the pool infinitely
source code
 
_force_reload(self, accepted)
Force the application reload and handle the one accepted socket
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
callable app
WSGI application
wtf.impl.ServerInterface impl
WSGI implementation
int maxqueue
Maximum of jobs in the queue (if no thread is available).
int maxspare
Maximum number of idle threads (remaining ones are killed off)
int maxthreads
Hard limit of number of threads
int minspare
Minimum number of idel threads (new threads are started if the threshold is reached)
socket.socket sock
Main socket
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, workerchild, reload_checker, impl, app)
(Constructor)

source code 
Initialization
Parameters:
Overrides: object.__init__

_force_reload(self, accepted)

source code 

Force the application reload and handle the one accepted socket

This method forks the process and proxies the socket to the new one.

Parameters:
  • accepted (tuple) - Accepted socket
Raises:

Instance Variable Details [hide private]

maxqueue

Maximum of jobs in the queue (if no thread is available). The queue blocks if maxqueue is reached.
Type:
int