Package obitools :: Package parallel :: Module jobqueue :: Class JobPool
[hide private]
[frames] | no frames]

Class JobPool

source code


JobPool is dedicated to manage a job queue. These jobs will run in a limited number of thread.

Instance Methods [hide private]
new empty dictionary

__init__(self, count, precision=0.01)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_runner(self) source code
 
_jobIterator(self) source code
 
_runJob(self, job) source code
int
submit(self, job, priority=1.0, userid=None)
Submit a new job to the JobPool.
source code
 
finalyze(self)
Indicate to the JobPool, that no new jobs will be submitted.
source code
 
__del__(self) source code

Inherited from dict: __cmp__, __contains__, __delitem__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __new__, __repr__, __setitem__, __sizeof__, clear, copy, fromkeys, get, has_key, items, iteritems, iterkeys, itervalues, keys, pop, popitem, setdefault, update, values

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from dict: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, count, precision=0.01)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • count (int) - number of thread dedicated to this JobPool
  • precision (float) - delay between two check for new job (in second)
Returns:
new empty dictionary

Overrides: object.__init__

submit(self, job, priority=1.0, userid=None)

source code 

Submit a new job to the JobPool.

Parameters:
  • job (Job instance) - the new submited job
  • priority (float) - priority level of this job (higher is better)
  • userid - a user identifier (Default is None)
Returns: int
job identifier