- """Commands are queued here, and executed in parallel (with
- threading) in accordance with the maximum number of allowed
- subprocesses, and result in callback execution when they finish."""
- def __init__(self, logger = False, dry = False, max = 10):
- super(ParallelShell, self).__init__(logger=logger,dry=dry)
+ """
+ Modifies the semantics of :class:`Shell` so that
+ commands are queued here, and executed in parallel using waitpid
+ with ``max`` subprocesses, and result in callback execution
+ when they finish.
+
+ .. method:: call(*args, **kwargs)
+
+ Enqueues a system call for parallel processing. If there are
+ no openings in the queue, this will block. Keyword arguments
+ are the same as :meth:`Shell.call` with the following additions:
+
+ :param on_success: Callback function for success (zero exit status).
+ The callback function should accept two arguments,
+ ``stdout`` and ``stderr``.
+ :param on_error: Callback function for failure (nonzero exit status).
+ The callback function should accept one argument, the
+ exception that would have been thrown by the synchronous
+ version.
+ :return: The :class:`subprocess.Proc` object that was opened.
+
+ .. method:: callAsUser(*args, **kwargs)
+
+ Enqueues a system call under a different user for parallel
+ processing. Keyword arguments are the same as
+ :meth:`Shell.callAsUser` with the additions of keyword
+ arguments from :meth:`call`.
+
+ .. method:: safeCall(*args, **kwargs)
+
+ Enqueues a "safe" call for parallel processing. Keyword
+ arguments are the same as :meth:`Shell.safeCall` with the
+ additions of keyword arguments from :meth:`call`.
+
+ .. method:: eval(*args, **kwargs)
+
+ No difference from :meth:`call`. Consider having a
+ non-parallel shell if the program you are shelling out
+ to is fast.
+
+ """
+ def __init__(self, dry = False, max = 10):
+ super(ParallelShell, self).__init__(dry=dry)