Call the next request from the queue
480606
function callNext() {
			/* istanbul ignore next */
			if (queue.length == 0) return;

			/* istanbul ignore next */
			if (currentInFlight >= opts.concurrency) return;

			const item = queue.shift();

			currentInFlight++;
			handler(item.ctx)
				.then(res => {
					currentInFlight--;
					item.resolve(res);
					callNext();
				})
				.catch(err => {
					currentInFlight--;
					item.reject(err);
					callNext();
				});
		}
745534
function randomCallback() {

  if (!randomQueue.length) {
    self.postMessage({ event: 'request-seed', amount: MAX_SIZE_RANDOM_BUFFER });
  }

  return new Promise(function(resolve) {
    randomQueue.push(resolve);
  });
}
1048637
def next(self, *args):
        """"""
        self.initialize()
        self.future = asyncio.Future(loop=self.loop)
        self.handle = self.loop.call_at(self.get_next(), self.call_func, *args)
        return self.future
265003
def request(self, method, args, response_cb):
        
        request_id = self._next_request_id
        self._next_request_id = request_id + 1
        self._msgpack_stream.send([0, request_id, method, args])
        self._pending_requests[request_id] = response_cb
849358
def schedule_next_request(self):
        
        req = self.next_request()

        if req:
            self.crawler.engine.crawl(req, spider=self)
456349
function serviceCall(req, res, next) {
        Q(pushService.fetchPushNotification(req.params.uuid)).then(res.json.bind(res), next).done();
    }
164486
def push(self, el):
        
        count = next(self.counter)
        heapq.heappush(self._queue, (el, count))
128040
function(id, msg, result) {
        var q = queues[id], sc;
        if (q && q.onEnd) {
            sc = q.context || q;
            q.onEnd.call(sc, _returnData(q, msg, result));
        }
    }
549539
private void triggerQueuedRequests() {
		if (triggerRequestQueued) {
			triggerRequestQueued = false;

			// trigger the checkpoint from the trigger timer, to finish the work of this thread before
			// starting with the next checkpoint
			if (periodicScheduling) {
				if (currentPeriodicTrigger != null) {
					currentPeriodicTrigger.cancel(false);
				}
				currentPeriodicTrigger = timer.scheduleAtFixedRate(
						new ScheduledTrigger(),
						0L, baseInterval, TimeUnit.MILLISECONDS);
			}
			else {
				timer.execute(new ScheduledTrigger());
			}
		}
	}
837607
def trace_next_query(self, ):
    
    self._seqid += 1
    d = self._reqs[self._seqid] = defer.Deferred()
    self.send_trace_next_query()
    return d
303862
def request_write(self, request: TBWriteRequest)->None:
        ""
        if self.stop_request.isSet(): return
        self.queue.put(request)
1090112
def _next_job(self):
        """"""
        if self.__job_queue:
            # Produce message from the top of the queue
            job = self.__job_queue.pop()
            # logging.debug("queue = %s, popped %r", self.__job_queue, job)
            job.process()
1268236
function dispatchQueuedRequests()
  {
    me.requestQueue.forEach(me.worker.send.bind(me.worker));
    me.requestQueue = [];
  }
1075020
function chainCallback(cb, next) {
    var browser = this;

    return function queueWrapped() {
        try {
            if (cb) {cb.apply(browser, arguments);}
            next();
        } catch (e) {
            next(e);
        }
    };
}
186435
def _next_middleware(
            self,
            middlewares: Iterator[MIDDLEWARE_TYPE],
            ctx: Context,
    ) -> NEXT_CALL_TYPE:
        
        @asyncio.coroutine
        def next_call() -> NEXT_CALL_RES_TYPE:
            """
            调用下一个中间件
            """
            yield from self._middleware_call(middlewares, ctx, next_call)
        return next_call
1009674
def _next_method(self):
        
        while self.queue.empty():
            try:
                frame_type, channel, payload = self.source.read_frame()
            except Exception, e:
                #
                # Connection was closed?  Framing Error?
                #
                self.queue.put(e)
                break

            if self.expected_types[channel] != frame_type:
                self.queue.put((
                    channel,
                    Exception('Received frame type %s while expecting type: %s' %
                        (frame_type, self.expected_types[channel])
                        )
                    ))
            elif frame_type == 1:
                self._process_method_frame(channel, payload)
            elif frame_type == 2:
                self._process_content_header(channel, payload)
            elif frame_type == 3:
                self._process_content_body(channel, payload)
780462
def request_get_next(request, default_next):
    
    next_url = request.POST.get('next')\
        or request.GET.get('next')\
        or request.META.get('HTTP_REFERER')\
        or default_next
    return next_url