Calls the resp_generator for all the requests in sequential order.
335172
def execute(self, requests, resp_generator, *args, **kwargs):
        '''
            
        '''
        return [resp_generator(request) for request in requests]
184932
def iter(context, sequence, limit=10):
    """"""
    params = {'limit': limit,
              'offset': 0}
    uri = '%s/%s/%s' % (context.dci_cs_api, RESOURCE, sequence)

    while True:
        j = context.session.get(uri, params=params).json()
        if len(j['jobs_events']):
            for i in j['jobs_events']:
                yield i
        else:
            break
        params['offset'] += params['limit']
1127265
def StartFileFetch(self, pathspec, request_data=None):
    """"""
    # Create an index so we can find this pathspec later.
    self.state.indexed_pathspecs.append(pathspec)
    self.state.request_data_list.append(request_data)
    self._TryToStartNextPathspec()
1158609
function golr_iter(resp){
    num_pages_done++;

    _ll('GOlr iter; total: ' + resp.total_documents() + ', ' +
	'start: ' + resp.start_document() + ', ' +
	'end: ' + resp.end_document() + ', ' + 
	'page: ' + num_pages_done);

    // Load the docs that we have so far.
    _insert_into_mongo(resp);

    // Now check to see if we need to keep going.
    if( resp.paging_p() && resp.paging_next_p() ){
	go.page_next();
    }else{
	_ll('no more paging');
	done_paging_p = true;
    }
}
860323
def schedule_next_requests(self):
        """"""
        # TODO: While there is capacity, schedule a batch of redis requests.
        for req in self.next_requests():
            self.crawler.engine.crawl(req, spider=self)
471221
def run(self):
        """"""
        resp = _wait_until(obj=self.obj, att=self.att,
                desired=self.desired, callback=None,
                interval=self.interval, attempts=self.attempts,
                verbose=False, verbose_atts=None)
        self.callback(resp)
454656
def on_finish(self):
        
        super(SessionRequestHandler, self).on_finish()
        LOGGER.debug('Entering SessionRequestHandler.on_finish: %s',
                     self.session.id)
        self.session.last_request_at = self.current_epoch()
        self.session.last_request_uri = self.request.uri
        if self.session.dirty:
            result = yield self.session.save()
            LOGGER.debug('on_finish yield save: %r', result)
        self.session = None
        LOGGER.debug('Exiting SessionRequestHandler.on_finish: %r',
                     self.session)
1120127
def _run_search_request(
            self, protocol_request, object_name, protocol_response_class):
        
        not_done = True
        while not_done:
            response_object = self._run_search_page_request(
                protocol_request, object_name, protocol_response_class)
            value_list = getattr(
                response_object,
                protocol.getValueListName(protocol_response_class))
            for extract in value_list:
                yield extract
            not_done = bool(response_object.next_page_token)
            protocol_request.page_token = response_object.next_page_token
858957
def iter(self, reset=False, reverse=False):
        
        files = os.listdir(self.source)
        files.sort(reverse=reverse)

        for filename in files:
            try:
                yield self.get(filename, reset)
            except PostNotFound:
                continue
680497
def reqresp_middleware(api=None):
    """"""
    def decorator(middleware_generator):
        apply_to_api = hug.API(api) if api else hug.api.from_object(middleware_generator)

        class MiddlewareRouter(object):
            __slots__ = ('gen', )

            def process_request(self, request, response):
                self.gen = middleware_generator(request)
                return self.gen.__next__()

            def process_response(self, request, response, resource, req_succeeded):
                return self.gen.send((response, resource))

        apply_to_api.http.add_middleware(MiddlewareRouter())
        return middleware_generator
    return decorator
643231
def ProcessAllReadyRequests(self):
    
    request_dict = data_store.REL_DB.ReadFlowRequestsReadyForProcessing(
        self.rdf_flow.client_id,
        self.rdf_flow.flow_id,
        next_needed_request=self.rdf_flow.next_request_to_process)
    if not request_dict:
      return 0

    processed = 0
    while self.rdf_flow.next_request_to_process in request_dict:
      request, responses = request_dict[self.rdf_flow.next_request_to_process]
      self.RunStateMethod(request.next_state, request, responses)
      self.rdf_flow.next_request_to_process += 1
      processed += 1
      self.completed_requests.append(request)

    if processed and self.IsRunning() and not self.outstanding_requests:
      self.RunStateMethod("End")
      if (self.rdf_flow.flow_state == self.rdf_flow.FlowState.RUNNING and
          not self.outstanding_requests):
        self.MarkDone()

    self.PersistState()

    if not self.IsRunning():
      # All requests and responses can now be deleted.
      self._ClearAllRequestsAndResponses()

    return processed
1023427
protected void loadRemaining() {
        if (!loadedAll) {
            // Put all of the batches from the sequence into the buffer
            assert targetNumRowsInMemory >= 0L;
            assert batchSize != null;
            Batch batch = original.nextBatch();
            boolean loadIntoMemory = inMemoryBatches != null && actualNumRowsInMemory < targetNumRowsInMemory;
            while (batch != null) {
                long rows = loadBatch(batch, loadIntoMemory, null);
                if (batchSize.get() == 0L) batchSize.set(rows);
                if (loadIntoMemory) {
                    assert inMemoryBatches != null;
                    if (actualNumRowsInMemory >= targetNumRowsInMemory) loadIntoMemory = false;
                }
                batch = original.nextBatch();
            }
            long numInMemory = inMemoryBatches != null ? actualNumRowsInMemory : 0L;
            totalSize = offHeapBatchesSupplier.size() + numInMemory;
            loadedAll = true;
            restartBatches();
        }
    }
1189808
def _respond(self, resp):
        """"""
        response_queue = self._response_queues.get(timeout=0.1)
        response_queue.put(resp)
        self._completed_response_lines = []
        self._is_multiline = None
1211009
def _iterator(self, response):
        '''
        
        '''

        while True:
            result = self._parse_data(response)
            bookmark = response.get('bookmark')
            if result:
                for row in result:
                    yield row

                del result

                if not bookmark:
                    break

                response = self._call(bookmark=bookmark)

            else:
                break
1070991
def collect(coro, index, results,
            preserve_order=False,
            return_exceptions=False):
    
    result = yield from safe_run(coro, return_exceptions=return_exceptions)

    if preserve_order:
        results[index] = result
    else:
        results.append(result)
227737
def items(self):
        
        if self._multipage:
            while True:
                # Pool for more torrents
                items = super(Paginated, self).items()
                # Stop if no more torrents
                first = next(items, None)
                if first is None:
                    raise StopIteration()
                # Yield them if not
                else:
                    yield first
                    for item in items:
                        yield item
                # Go to the next page
                self.next()
        else:
            for item in super(Paginated, self).items():
                yield item
954868
public void sync() {
    if (getPipelinedResponseLength() > 0) {
      List<Object> unformatted = client.getMany(getPipelinedResponseLength());
      for (Object o : unformatted) {
        generateResponse(o);
      }
    }
  }