def _exec_first_ready_in_order(ready_tasks, ordered_tasks, ch_ops,
    _exec_first_ready=_exec_first_ready):
    """Execute the first ready task from ordered_task.

    Returns a tuple of (execution_output, retry_ch_opts), one element will be
    None.
    """
    next_ch_opts = []
    for i, task in enumerate(ordered_tasks):
        if task in ready_tasks:
            ready = ch_ops[i]
            out = _exec_first_ready((ready,))
            if out:
                return out, None
        else:
            next_ch_opts.append(ch_ops[i])
    return None, next_ch_opts
