'Perform one iteration of the current task..
Calls self.get_current_task() to find the current task.
Remove task from self.tasks if it is complete.'

def iteration(self):

    try:
        task = self.get_current_task()
    except StopIteration:
        return 0
    try:
        ret = task()
    except StopIteration:
        pass
    except Exception:
        traceback.print_exc()
    else:
        if ret:
            return ret
    self.tasks.remove(task)
    return 0
