Module Task
source code
ClusterShell Task module.
Simple example of use:
>>> from ClusterShell.Task import *
>>>
>>>
... task = task_self()
>>>
>>>
... task.shell("/bin/uname -r", nodes="tiger[1-30,35]")
<ClusterShell.Worker.Ssh.WorkerSsh object at 0x7f41da71b890>
>>>
>>>
... task.resume()
>>>
>>>
... for buf, nodelist in task.iter_buffers():
... print NodeSet.fromlist(nodelist), buf
...
|
|
TaskException
Base task exception.
|
|
|
TaskError
Base task error exception.
|
|
|
TimeoutError
Raised when the task timed out.
|
|
|
AlreadyRunningError
Raised when trying to resume an already running task.
|
|
|
TaskMsgTreeError
Raised when trying to access disabled MsgTree.
|
|
|
_TaskMsgTree
Task special MsgTree wrapper class, for easy disabling of MsgTree
buffering.
|
|
|
Task
Always bound to a thread, the Task class allows you to execute
commands in parallel and get their results.
|
|
|
|
|
|
|
|
|
task_wait()
Suspend execution of the calling thread until all tasks terminate,
unless all tasks have already terminated. |
source code
|
|
|
|
|
|
|
|
|
|
__package__ = 'ClusterShell'
|
|
Default task debug printing function. Cannot provide 'print' directly
as it is not a function (will be in Py3k!).
|
|
Get the Task instance bound to the current thread. This function
provided as a convenience is available in the top-level ClusterShell.Task
package namespace.
|
|
Suspend execution of the calling thread until all tasks terminate,
unless all tasks have already terminated. This function is provided as a
convenience and is available in the top-level ClusterShell.Task package
namespace.
|
|
Destroy the Task instance bound to the current thread. A next call to
task_self() will create a new Task object. This function provided as a
convenience is available in the top-level ClusterShell.Task package
namespace.
|
|
Cleanup routine to destroy all created tasks. This function provided
as a convenience is available in the top-level ClusterShell.Task package
namespace.
|