Package wtf :: Package opi :: Package worker :: Class WorkerInterface
[hide private]
[frames] | no frames]

Class WorkerInterface

source code

object --+
         |
        WorkerInterface

Interface for worker implementations
Instance Methods [hide private]
 
__init__(self, config, opts, args)
Initialization
source code
WorkerPoolInterface
setup(self, sock, prerun, parent_cleanup, child_cleanup)
Setup the worker pool
source code

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

Instance Variables [hide private]
bool sig_hup
Should SIGHUP restart the worker?
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, config, opts, args)
(Constructor)

source code 
Initialization
Parameters:
  • config (wtf.config.Config) - The application config
  • opts (optparse.OptionContainer) - Command line option container
  • args (list) - Fixed commandline arguments
Overrides: object.__init__

setup(self, sock, prerun, parent_cleanup, child_cleanup)

source code 
Setup the worker pool
Parameters:
  • sock - The main listener socket
  • prerun - Pre-runner (called right after finishing the setup), called once
  • parent_cleanup - Parent cleanup, if the implementation forks, called once
  • child_cleanup - Child cleanup, if the implementation forks, called every time
Returns: WorkerPoolInterface
The worker pool