Package qubx :: Module task
[hide private]
[frames] | no frames]

Module task

source code

Thread management and multiprocessing.

Copyright 2008-2012 Research Foundation State University of New York This file is part of QUB Express.

QUB Express is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QUB Express is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License, named LICENSE.txt, in the QUB Express program directory. If not, see <http://www.gnu.org/licenses/>.

Classes [hide private]
  TaskManager
Maintains a list of running tasks; can interrupt one or all; use global variable Tasks."
  GTK_Main_Hold
Context manager, for use in a Task thread, which pauses the main thread while it is entered.
  Robot_Hold
Context manager, for use in a Task thread, which pauses a Robot (or Robots) thread while it is entered.
  Task
A worker thread; not started until .start().
  Robot
A worker thread which services a queue of callables.
  Homunculus
A worker thread which services a queue of callables.
  PoolTask
A worker thread which controls a multiprocessing.Pool of worker processes.
  Robots
A worker thread with a pool of worker processes, servicing a queue of callables.
  Homunculi
A worker thread with a pool of worker processes, servicing a queue of callables.
Functions [hide private]
 
throw_in(tid, exc)
Raises Exception exc in thread tid.
source code
 
idle_wait(fn, *args, **kw)
Returns the result of fn(*args, **kw) called in the gtk main thread; calling thread pauses until fn completes.
source code
Variables [hide private]
  Tasks = <qubx.task.TaskManager object>
  __package__ = 'qubx'
  e = 2.71828182846
  pi = 3.14159265359
Function Details [hide private]

throw_in(tid, exc)

source code 

Raises Exception exc in thread tid. Actually it is raised sometime in the next "check interval" instructions.