Package papyros :: Class Slave
[hide private]
[frames] | no frames]

Class Slave

source code

object --+
         |
        Slave
Known Subclasses:
multithreaded.MultiThreadedSlave, distributed.DistributedSlave, singlethreaded.SingleThreadedMaster

Abstract Slave class.

A Slave sits in a loop waiting for Jobs from its Master, picks the next available job, processes it, sends it back to the Master and all over again.

Instance Methods [hide private]
 
__init__(self, master, poll_time=1)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
run(self) source code
 
process(self)
Fetch the next available unassigned job from the master, process it and send it back.
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, master, poll_time=1)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Parameters:
  • master - The Master this slaves is communicating with.
  • poll_time - How often should this slave poll its master for a new Job.
Overrides: object.__init__

process(self)

source code 
Fetch the next available unassigned job from the master, process it and send it back.
Returns:
The processed job, or None if no job was assigned within poll_time seconds.