workers.base

Module Contents

Classes

Worker(self,age,ppid,sockets,app,timeout,cfg,log)
class Worker(age, ppid, sockets, app, timeout, cfg, log)
__init__(age, ppid, sockets, app, timeout, cfg, log)

This is called pre-fork so it shouldn’t do anything to the current process. If there’s a need to make process wide changes you’ll want to do that in self.init_process().

__str__()
notify()

Your worker subclass must arrange to have this method called once every self.timeout seconds. If you fail in accomplishing this task, the master process will murder your workers.

run()

This is the mainloop of a worker process. You should override this method in a subclass to provide the intended behaviour for your particular evil schemes.

init_process()

If you override this method in a subclass, the last statement in the function should be to call this method with super(MyWorkerClass, self).init_process() so that the run() loop is initiated.

load_wsgi()
init_signals()
handle_usr1(sig, frame)
handle_exit(sig, frame)
handle_quit(sig, frame)
handle_abort(sig, frame)
handle_error(req, client, addr, exc)
handle_winch(sig, fname)