def runloop(self):
        while self.keep_going:
            eventlet.sleep(0.1)
            ## Only start the number of children we need
            number = self.num_processes - self.children_count()
            if number > 0:
                self.log.debug('Should start %d new children', number)
                self.spawn_children(number=number)
                continue

            if not self.children:
                ## If we don't yet have children, let's loop
                continue

            pid, result = None, None
            try:
                pid, result = os.wait()
            except __HOLE__, e:
                if e.errno != errno.EINTR:
                    raise

            if pid and self.children.get(pid):
                try:
                    child = self.children.pop(pid)
                    os.close(child.kill_pipe)
                except (IOError, OSError):
                    pass

            if result:
                signum = os.WTERMSIG(result)
                exitcode = os.WEXITSTATUS(result)
                self.log.info('(%s) Child died from signal %s with code %s',
                              pid, signum, exitcode)
dataset/ETHPy150Open rtyler/Spawning/spawning/spawning_controller.py/Controller.runloop