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

Class WorkerMedium

source code

 twisted.spread.jelly.Jellyable --+                    
                                  |                    
twisted.spread.flavors.Serializable --+                
                                      |                
   twisted.spread.flavors.Referenceable --+            
                                          |            
                    common.log.Loggable --+            
                                          |            
                   twisted.pb.Referenceable --+        
                                              |        
                       common.medium.BaseMedium --+    
                                                  |    
                        common.medium.PingingMedium --+
                                                      |
                                                     WorkerMedium

I am a medium interfacing with the manager-side WorkerAvatar.

Instance Methods [hide private]
 
__init__(self, brain, ports) source code
list of int
remote_getPorts(self)
Gets the range of feed ports that this worker was configured to use.
source code
int, or NoneType
remote_getFeedServerPort(self)
Return the TCP port the Feed Server is listening on.
source code
 
remote_create(self, *args, **kwargs)
Start a component of the given type with the given nice level.
source code
list of str
remote_checkElements(self, elementNames)
Checks if one or more GStreamer elements are present and can be instantiated.
source code
 
remote_checkImport(self, moduleName)
Checks if the given module can be imported.
source code
 
remote_runFunction(self, module, function, *args, **kwargs)
Runs the given function in the given module with the given arguments.
source code
 
remote_getComponents(self)
I return a list of componentAvatarIds, I have.
source code

Inherited from common.medium.PingingMedium: setRemoteReference, startPinging, stopPinging

Inherited from common.medium.BaseMedium: callRemote, callRemoteLogging, hasRemoteReference, runBundledFunction

Inherited from twisted.pb.Referenceable: remoteMessageReceived

Inherited from twisted.spread.flavors.Referenceable: jellyFor

Inherited from twisted.spread.flavors.Serializable: processUniqueID

Inherited from twisted.spread.jelly.Jellyable: __providedBy__, getStateFor

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

Class Variables [hide private]
  logCategory = 'workermedium'
Implementors can provide a category to log their messages under.
  __implemented__ = <implementedBy flumotion.worker.worker.Worke...
  __provides__ = <zope.interface.declarations.ClassProvides obje...

Inherited from common.medium.BaseMedium: bundleLoader, remoteLogName

Inherited from twisted.spread.flavors.Referenceable: perspective

Instance Variables [hide private]
WorkerBrain brain
the worker brain

Inherited from common.medium.BaseMedium: remote

Method Details [hide private]

__init__(self, brain, ports)
(Constructor)

source code 
Parameters:

remote_getPorts(self)

source code 

Gets the range of feed ports that this worker was configured to use.

Returns: list of int
list of ports

remote_getFeedServerPort(self)

source code 

Return the TCP port the Feed Server is listening on.

Returns: int, or NoneType
TCP port number, or None if there is no feed server

remote_create(self, *args, **kwargs)

source code 

Start a component of the given type with the given nice level. Will spawn a new job process to run the component in.

Parameters:
  • avatarId (str) - avatar identification string
  • type (str) - type of the component to create
  • moduleName (str) - name of the module to create the component from
  • methodName (str) - the factory method to use to create the component
  • nice (int) - nice level
Returns:
a deferred fired when the process has started and created the component

remote_checkElements(self, elementNames)

source code 

Checks if one or more GStreamer elements are present and can be instantiated.

Parameters:
  • elementNames (list of str) - names of the Gstreamer elements
Returns: list of str
a list of instantiatable element names

remote_checkImport(self, moduleName)

source code 

Checks if the given module can be imported.

Parameters:
  • moduleName (str) - name of the module to check
Returns:
None or Failure

remote_runFunction(self, module, function, *args, **kwargs)

source code 

Runs the given function in the given module with the given arguments.

Parameters:
  • module (str) - module the function lives in
  • function (str) - function to run
Returns:
the return value of the given function in the module.

remote_getComponents(self)

source code 

I return a list of componentAvatarIds, I have. I am called by the manager soon after I attach to it. This is needed on reconnects so that the manager knows what components it needs to start on me.

Returns:
a list of componentAvatarIds

Class Variable Details [hide private]

__implemented__

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

__provides__

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