code: def _actionsiter(self, message_iterator):
          
          for message in message_iterator:
              payload = message.decode()
              try:
                  if payload['op'] == 'delete':
                      yield self._delete_action(payload)
                  else:
                      yield self._index_action(payload)
                  message.ack()
              except NoResultFound:
                  message.reject()
              except Exception:
                  message.reject()
                  current_app.logger.error(
                      "Failed to index record {0}".format(payload.get('id')),
                      exc_info=True)
docs: Iterate bulk actions.
  
          :param message_iterator: Iterator yielding messages from a queue.