Package mbuild :: Module work_queue :: Class work_queue_t
[frames] | no frames]

Class work_queue_t

source code

object --+
         |
        work_queue_t

This stores the threads and controls their execution

Instance Methods
 
__del__(self) source code
 
__init__(self, max_parallelism=4)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
add(self, command)
Add a command or list of commands of type command_t to the list of jobs to run.
source code
list of command_t
add_sequential(self, command_strings, unbufferred=False)
Add a list of command strings as sequential tasks to the work queue.
source code
 
build(self, dag=None, targets=None, die_on_errors=True, show_output=True, error_limit=0, show_progress=False, show_errors_only=False, join_timeout=10.0)
This makes the work queue start building stuff.
source code
 
clear_commands(self)
Remove any previously remembered commands
source code
 
commands(self)
Return list of all commands involved in last build
source code
string
elapsed(self)
Return the elapsed time as a pretty string
source code
 
elapsed_time(self)
Return the elapsed time as an a number
source code

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

Properties

Inherited from object: __class__

Method Details

__init__(self, max_parallelism=4)
(Constructor)

source code 

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

Parameters:
  • max_parallelism (int) - the number of worker threads to start
Overrides: object.__init__

add(self, command)

source code 

Add a command or list of commands of type command_t to the list of jobs to run.

Parameters:

add_sequential(self, command_strings, unbufferred=False)

source code 

Add a list of command strings as sequential tasks to the work queue.

Parameters:
  • command_strings (list of strings) - command strings to add to the work_queue_t
Returns: list of command_t
the commands created

build(self, dag=None, targets=None, die_on_errors=True, show_output=True, error_limit=0, show_progress=False, show_errors_only=False, join_timeout=10.0)

source code 

This makes the work queue start building stuff. If no targets are specified then all the targets are considered and built if necessary. All commands that get run or generated are stored in the all_commands attribute. That attribute gets re-initialized on each call to build.

Parameters:
  • dag (dag_t) - the dependence tree object
  • targets (list) - specific targets to build
  • die_on_errors (bool) - keep going or die on errors
  • show_output (bool) - show stdout/stderr (or just buffer it in memory for later processing). Setting this to False is good for avoiding voluminous screen output. The default is True.
  • show_progress (bool) - show the running/pending/completed/errors msgs
  • show_errors_only (bool) - normally print the commands as they complete. If True, only show the commands that fail.
  • join_timeout (float) - how long to wait for thread to terminate. default 10s

elapsed(self)

source code 

Return the elapsed time as a pretty string

Returns: string
the elapsed wall clock time of execution.