Package mdp :: Package parallel :: Class OrderedResultContainer
[hide private]
[frames] | no frames]

Class OrderedResultContainer


Default result container with automatic restoring of the result order.

In general the order of the incoming results in the scheduler can be
different from the order of the tasks, since some tasks may finish quicker
than other tasks. This result container restores the original order.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
 
add_result(self, result, task_index)
Store a result in the container.
 
get_results(self)
Sort the results into the original order and return them in list.

Inherited from unreachable.newobject: __long__, __native__, __nonzero__, __unicode__, next

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

add_result(self, result, task_index)

 
Store a result in the container.

The task index is also stored and later used to reconstruct the
original task order.

Overrides: ResultContainer.add_result

get_results(self)

 
Sort the results into the original order and return them in list.

Overrides: ResultContainer.get_results