'An iterator which returns all the responses in order.'

def __iter__(self):

    old_response_id = None
    action_registry = server_stubs.ClientActionStub.classes
    expected_response_classes = []
    is_client_request = False
    if self.request.HasField('request'):
        is_client_request = True
        client_action_name = self.request.request.name
        if (client_action_name not in action_registry):
            raise RuntimeError(('Got    unknown    client    action:    %s.' % client_action_name))
        expected_response_classes = action_registry[client_action_name].out_rdfvalues
    for message in self._responses:
        self.message = rdf_flows.GrrMessage(message)
        if (self.message.response_id == old_response_id):
            continue
        else:
            old_response_id = self.message.response_id
        if (self.message.type == self.message.Type.MESSAGE):
            if is_client_request:
                if (not expected_response_classes):
                    raise RuntimeError(('Client    action    %s    does    not    specify    out_rdfvalue.' % client_action_name))
                else:
                    args_rdf_name = self.message.args_rdf_name
                    if (not args_rdf_name):
                        raise RuntimeError('Deprecated    message    format    received:    args_rdf_name    is    None.')
                    elif (args_rdf_name not in [x.__name__ for x in expected_response_classes]):
                        raise RuntimeError(('Response    type    was    %s    but    expected    %s    for    %s.' % (args_rdf_name, expected_response_classes, client_action_name)))
            (yield self.message.payload)
