Package web2py :: Package gluon :: Module sneaky3 :: Class Worker
[hide private]
[frames] | no frames]

Class Worker

source code

        object --+        
                 |        
threading._Verbose --+    
                     |    
      threading.Thread --+
                         |
                        Worker

class representing a worker node

Instance Methods [hide private]
 
run(self)
runs the thread:
source code
 
die(self)
kills this thread, must be called by run()
source code
 
build_environ(self, wsgi_file)
parse request and build WSGI environ
source code
 
start_response(self, status, headers)
to be passed as second argument to wsgi_app
source code
 
respond(self, environ, data_items)
called after wsgi_app successfully retruns
source code
 
try_error_response(self, status="500 INTERNAL SERVER ERROR")
called if thread fails
source code
 
resize_thread_pool(self)
created new Worker(s) or kills some Worker(s)
source code

Inherited from threading.Thread: __init__, __repr__, getName, isAlive, isDaemon, join, setDaemon, setName, start

Inherited from threading.Thread (private): _set_daemon

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Class Variables [hide private]
  queue = Queue()
  threads = set()
  wsgi_apps = []
  server_name = 'Sneaky'
  min_threads = 10
  max_threads = 10
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

run(self)

source code 

runs the thread:

  • pick a request from queue
  • parse input
  • run wsgi_app
  • send response
  • resize set of threads
Overrides: threading.Thread.run