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

Class WorkerBrain

Loggable --+
           |
          WorkerBrain


I am the main object in the worker process, managing jobs and everything related. I live in the main worker process.
Method Summary
  __init__(self, options)
  callRemote(self, methodName, *args, **kwargs)
twisted.internet.defer.Deferred deferredCreate(self, avatarId)
Create and register a deferred for creating the given component.
  deferredCreateFailed(self, avatarId, exception)
Notify the caller that a create has failed, and remove the create from the list of pending creates.
  deferredCreateRegistered(self, avatarId)
Check if a deferred create has been registered for the given avatarId.
  deferredCreateTrigger(self, avatarId)
Trigger a previously registered deferred for creating up the given component.
twisted.internet.defer.Deferred deferredShutdown(self, avatarId)
Create and register a deferred for notifying the worker of a clean job shutdown.
  deferredShutdownRegistered(self, avatarId)
Check if a deferred shutdown has been registered for the given avatarId.
  deferredShutdownTrigger(self, avatarId)
Trigger a previously registered deferred for creating up the given component.
  eatFromFD(self, componentId, feedId, fd)
Called from the FeedAvatar to pass a file descriptor on to the job running the given component.
  feedToFD(self, componentId, feedName, fd, eaterId)
Called from the FeedAvatar to pass a file descriptor on to the job running the component for this feeder.
  listen(self)
Start listening on FeedServer (incoming eater requests) and JobServer (through which we communicate with our children) ports
  login(self, authenticator)
  shutdownHandler(self)
  teardown(self)
Clean up after setup()
    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.

Instance Variable Summary
  authenticator: authenticator worker used to log in to manager @type authenticator flumotion.twisted.pb.Authenticator
int feedServerPort: TCP port the Feed Server is listening on
JobHeaven jobHeaven:  
Kindergarten kindergarten:  
WorkerMedium medium:  
WorkerClientFactory workerClientFactory:  

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

Method Details

__init__(self, options)
(Constructor)

Parameters:
options - the optparsed dictionary of command-line options
           (type=an object with attributes)

deferredCreate(self, avatarId)

Create and register a deferred for creating the given component. This deferred will be fired when the JobAvatar has instructed the job to create the component.
Returns:
twisted.internet.defer.Deferred

deferredCreateFailed(self, avatarId, exception)

Notify the caller that a create has failed, and remove the create from the list of pending creates.

deferredCreateRegistered(self, avatarId)

Check if a deferred create has been registered for the given avatarId.

deferredCreateTrigger(self, avatarId)

Trigger a previously registered deferred for creating up the given component.

deferredShutdown(self, avatarId)

Create and register a deferred for notifying the worker of a clean job shutdown. This deferred will be fired when the job is reaped.
Returns:
twisted.internet.defer.Deferred

deferredShutdownRegistered(self, avatarId)

Check if a deferred shutdown has been registered for the given avatarId.

deferredShutdownTrigger(self, avatarId)

Trigger a previously registered deferred for creating up the given component.

eatFromFD(self, componentId, feedId, fd)

Called from the FeedAvatar to pass a file descriptor on to the job running the given component.
Returns:
whether the fd was successfully handed off to the component.

feedToFD(self, componentId, feedName, fd, eaterId)

Called from the FeedAvatar to pass a file descriptor on to the job running the component for this feeder.
Returns:
whether the fd was successfully handed off to the component.

listen(self)

Start listening on FeedServer (incoming eater requests) and JobServer (through which we communicate with our children) ports
Returns:
True if we successfully listened on both ports

teardown(self)

Clean up after setup()
Returns:
a twisted.internet.defer.Deferred that fires when the teardown is completed

Instance Variable Details

authenticator

authenticator worker used to log in to manager @type authenticator flumotion.twisted.pb.Authenticator

feedServerPort

TCP port the Feed Server is listening on
Type:
int

jobHeaven

Type:
JobHeaven

kindergarten

Type:
Kindergarten

medium

Type:
WorkerMedium

workerClientFactory

Type:
WorkerClientFactory

Class Variable Details

__implemented__

Type:
Implements
Value:
<implementedBy flumotion.worker.worker.WorkerBrain>                    

__provides__

Type:
ClassProvides
Value:
<zope.interface.declarations.ClassProvides object at 0x2b41a69fc110>   

logCategory

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

Generated by Epydoc 2.1 on Fri Apr 6 10:13:40 2007 http://epydoc.sf.net