Table Of Contents
Table Of Contents

inet.common.task.MultipleTasks

class inet.common.task.MultipleTasks(tasks=[], name='task', concurrent=True, pass_keyboard_interrupt=False, randomize=False, chunksize=1, scheduler='thread', cluster=None, multiple_task_results_class=MultipleTaskResults, **kwargs)

Represents multiple tasks that can be run together.

Initializes a new multiple tasks object.

Parameters:
  • tasks (List of Task) – The list of individual tasks that are run when this multiple tasks is run.

  • name (string) – A human readable short description of the multiple tasks, usually a noun.

  • concurrent (bool) – Specifies if the individual tasks are run sequentially or concurrently.

  • randomize (bool) – Specifies if the order of execution is random or follows the order of storage for the tasks.

  • chunksize (integer) – The number of tasks that are run together in a single batch if the tasks are running concurrently.

  • scheduler (string) – Specifies how the tasks are scheduled. Valid values are “process”, “thread”, and “cluster”.

  • multiple_task_results_class (string) – The Python class name of the produced multiple task results object.

rerun(**kwargs)

Runs the tasks again.

Returns (MultipleTaskResults):

The task results.

run(context=None, progress=None, index=0, count=1, **kwargs)

Runs all tasks sequentially or concurrently.

Parameters:

kwargs (dict) – Additional parameters are inherited from Task.run().

Returns (MultipleTaskResults):

The task results.