'This is the workhorse. It will take the intial jobs from the _queue,
start them, add them to _running, and then go into the main running
loop.
This loop will check for done procs, if found, move them out of
_running into _completed. It also checks for a _running queue with open
spots, which it will then fill as discovered.
To end the loop, there have to be no running procs, and no more procs
to be run in the queue.
This function returns an iterable of all its children\'s exit codes.'

def run(self):

    def _advance_the_queue():
        '\n                                                Helper    function    to    do    the    job    of    poping    a    new    proc    off    the    queue\n                                                start    it,    then    add    it    to    the    running    queue.    This    will    eventually\n                                                depleate    the    _queue,    which    is    a    condition    of    stopping    the    running\n                                                while    loop.\n\n                                                It    also    sets    the    env.host_string    from    the    job.name,    so    that    fabric\n                                                knows    that    this    is    the    host    to    be    making    connections    on.\n                                                '
        job = self._queued.pop()
        if self._debug:
            print ("Popping    '%s'    off    the    queue    and    starting    it" % job.name)
        with settings(clean_revert=True, host_string=job.name, host=job.name):
            job.start()
        self._running.append(job)
    results = {}
    for job in self._queued:
        results[job.name] = dict.fromkeys(('exit_code', 'results'))
    if (not self._closed):
        raise Exception('Need    to    close()    before    starting.')
    if self._debug:
        print 'Job    queue    starting.'
    while (len(self._running) < self._max):
        _advance_the_queue()
    while (not self._finished):
        while ((len(self._running) < self._max) and self._queued):
            _advance_the_queue()
        if (not self._all_alive()):
            for (id, job) in enumerate(self._running):
                if (not job.is_alive()):
                    if self._debug:
                        print ('Job    queue    found    finished    proc:    %s.' % job.name)
                    done = self._running.pop(id)
                    self._completed.append(done)
            if self._debug:
                print ('Job    queue    has    %d    running.' % len(self._running))
        if (not (self._queued or self._running)):
            if self._debug:
                print 'Job    queue    finished.'
            for job in self._completed:
                job.join()
            self._finished = True
        self._fill_results(results)
        time.sleep(ssh.io_sleep)
    self._fill_results(results)
    for job in self._completed:
        if isinstance(job, Process):
            results[job.name]['exit_code'] = job.exitcode
    return results
