Package flumotion :: Package worker :: Module worker :: Class WorkerBrain
[hide private]

Class WorkerBrain

source code

common.log.Loggable --+
                      |
                     WorkerBrain

I am the main object in the worker process, managing jobs and everything related. I live in the main worker process.

Instance Methods [hide private]
 
__init__(self, options) source code
 
listen(self)
Start listening on FeedServer (incoming eater requests) and JobServer (through which we communicate with our children) ports
source code
 
login(self, authenticator) source code
 
_setupJobServer(self)
Returns: (factory, port)
source code
 
_setupFeedServer(self)
Returns: (port, portNumber)
source code
 
teardown(self)
Clean up after setup()
source code
 
callRemote(self, methodName, *args, **kwargs) source code
 
shutdownHandler(self) source code
twisted.internet.defer.Deferred
deferredCreate(self, avatarId)
Create and register a deferred for creating the given component.
source code
 
deferredCreateTrigger(self, avatarId)
Trigger a previously registered deferred for creating up the given component.
source code
 
deferredCreateFailed(self, avatarId, exception)
Notify the caller that a create has failed, and remove the create from the list of pending creates.
source code
 
deferredCreateRegistered(self, avatarId)
Check if a deferred create has been registered for the given avatarId.
source code
twisted.internet.defer.Deferred
deferredShutdown(self, avatarId)
Create and register a deferred for notifying the worker of a clean job shutdown.
source code
 
deferredShutdownTrigger(self, avatarId)
Trigger a previously registered deferred for creating up the given component.
source code
 
deferredShutdownRegistered(self, avatarId)
Check if a deferred shutdown has been registered for the given avatarId.
source code
 
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.
source code
 
eatFromFD(self, componentId, feedId, fd)
Called from the FeedAvatar to pass a file descriptor on to the job running the given component.
source code

Inherited from common.log.Loggable: __providedBy__, debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Class Variables [hide private]
  logCategory = 'workerbrain'
Implementors can provide a category to log their messages under.
  __implemented__ = <implementedBy flumotion.worker.worker.Worke...
  __provides__ = <zope.interface.declarations.ClassProvides obje...
Instance Variables [hide private]
  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
Method Details [hide private]

__init__(self, options)
(Constructor)

source code 
Parameters:
  • options (an object with attributes) - the optparsed dictionary of command-line options

listen(self)

source code 

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

_setupJobServer(self)

source code 
Returns:
(factory, port)

_setupFeedServer(self)

source code 
Returns:
(port, portNumber)

teardown(self)

source code 

Clean up after setup()

Returns:
a twisted.internet.defer.Deferred that fires when the teardown is completed

deferredCreate(self, avatarId)

source code 

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

deferredShutdown(self, avatarId)

source code 

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

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

source code 

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.

eatFromFD(self, componentId, feedId, fd)

source code 

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.

Class Variable Details [hide private]

__implemented__

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

__provides__

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