Table of Contents

Class: Scheduler Bio/Tools/MultiProc/Scheduler.py

Schedules threads to be run. No prioritization. Nothing fancy.

Methods: add Add a thread to be run. num_left Return the number of threads left. num_running Return the number of threads currently running. run Main loop. Returns whether there's still threads left.

Methods   
__init__
add
num_left
num_running
run
  __init__ 
__init__ (
        self,
        max_threads,
        start_fn=None,
        finish_fn=None,
        )

Scheduler(max_threads[, start_fn][, finish_fn]) -> object

max_threads is the maximum number of threads to run at a time. start_fn and finish_fn are optional callbacks that take a thread as an argument. They are called before and after each thread.

Exceptions   
ValueError, "You must specify a positive number of threads!"
  add 
add ( self,  thread )

  1. add(thread)

  num_left 
num_left ( self )

  1. num_left() -> number of threads left to run

  num_running 
num_running ( self )

  1. num_running() -> number of threads currently running

  run 
run ( self )

  1. run() -> boolean

    Execute the main loop. Return a boolean indicating whether threads are still running.


Table of Contents

This document was automatically generated on Mon Jul 1 12:03:05 2002 by HappyDoc version 2.0.1