Package flumotion :: Package worker :: Module worker :: Class Kindergarten
[show private | hide private]
[frames | no frames]

Class Kindergarten

Loggable --+
           |
          Kindergarten


I spawn job processes. I live in the worker brain.
Method Summary
  __init__(self, options, socketPath, brain)
  getKid(self, avatarId)
  getKidAvatarIds(self)
  getKids(self)
  play(self, avatarId, type, moduleName, methodName, nice, bundles)
Create a kid and make it "play" by starting a job.
boolean removeKidByPid(self, pid)
Remove the kid from the kindergarten based on the pid.
  setOnShutdown(self, d)
Set a deferred to fire when we have no children
  terminateAll(self)
    Inherited from Loggable
  debug(self, *args)
Log a debug message.
dict doLog(self, level, where, format, *args, **kwargs)
Log a message at the given level, with the possibility of going higher up in the stack.
  error(self, *args)
Log an error.
  info(self, *args)
Log an informational message.
  log(self, *args)
Log a log message.
  logFunction(self, *args)
Overridable log function.
  logObjectName(self)
Overridable object name function.
  warning(self, *args)
Log a warning.
  warningFailure(self, failure, swallow)
Log a warning about a Failure.

Class Variable Summary
str logCategory: Implementors can provide a category to log their messages under.
    Inherited from Loggable
Implements __implemented__ = <implementedBy flumotion.common.log.Lo...
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...

Method Details

__init__(self, options, socketPath, brain)
(Constructor)

Parameters:
options - the optparse option instance of command-line options
           (type=dict)
socketPath - the path of the Unix domain socket for PB
           (type=str)
brain - a reference to the worker brain
           (type=WorkerBrain)

play(self, avatarId, type, moduleName, methodName, nice, bundles)

Create a kid and make it "play" by starting a job. Starts a component with the given name, of the given type, with the given nice level.

This will spawn a new flumotion-job process.
Parameters:
avatarId - avatarId the component should use to log in
           (type=str)
type - type of component to start
           (type=str)
moduleName - name of the module to create the component from
           (type=str)
methodName - the factory method to use to create the component
           (type=str)
nice - nice level
           (type=int)
bundles - ordered list of (bundleName, bundlePath) for this component
           (type=list of (str, str))

removeKidByPid(self, pid)

Remove the kid from the kindergarten based on the pid. Called by the signal handler in the brain.
Returns:
whether or not a kid with that pid was removed
           (type=boolean)

setOnShutdown(self, d)

Set a deferred to fire when we have no children

Class Variable Details

logCategory

Implementors can provide a category to log their messages under.
Type:
str
Value:
'workerbrain'                                                          

Generated by Epydoc 2.1 on Mon Jul 30 18:00:10 2007 http://epydoc.sf.net