Requests are queued for delivery.
5419
def indication(self, pdu):
        """"""
        if _debug: TCPServer._debug("indication %r", pdu)

        self.request += pdu.pduData
575994
def queue(self):
        """"""
        with self.connection_pool.acquire(block=True) as conn:
            return Q(
                self.routing_key,
                exchange=self.exchange,
                routing_key=self.routing_key
            )(conn)
974186
def queue_for_workers(input=nil)
      input ||= JSON.parse(self.inputs)
      input.each {|i| WorkUnit.start(self, action, i, status) }
      self
    end
1173414
def enqueue_request(self, request):
        '''
        
        '''
        if not request.dont_filter and self.dupefilter.request_seen(request):
            self.logger.debug("Request not added back to redis")
            return
        req_dict = self.request_to_dict(request)

        if not self.is_blacklisted(req_dict['meta']['appid'],
                                   req_dict['meta']['crawlid']):
            # grab the tld of the request
            ex_res = self.extract(req_dict['url'])
            key = "{sid}:{dom}.{suf}:queue".format(
                sid=req_dict['meta']['spiderid'],
                dom=ex_res.domain,
                suf=ex_res.suffix)

            curr_time = time.time()

            domain = "{d}.{s}".format(d=ex_res.domain, s=ex_res.suffix)

            # allow only if we want all requests or we want
            # everything but blacklisted domains
            # insert if crawl never expires (0) or time < expires
            if (self.backlog_blacklist or
                    (not self.backlog_blacklist and
                    domain not in self.black_domains)) and \
                    (req_dict['meta']['expires'] == 0 or
                    curr_time < req_dict['meta']['expires']):
                # we may already have the queue in memory
                if key in self.queue_keys:
                    self.queue_dict[key][0].push(req_dict,
                                              req_dict['meta']['priority'])
                else:
                    # shoving into a new redis queue, negative b/c of sorted sets
                    # this will populate ourself and other schedulers when
                    # they call create_queues
                    self.redis_conn.zadd(key, ujson.dumps(req_dict),
                                        -req_dict['meta']['priority'])
                self.logger.debug("Crawlid: '{id}' Appid: '{appid}' added to queue"
                    .format(appid=req_dict['meta']['appid'],
                            id=req_dict['meta']['crawlid']))
            else:
                self.logger.debug("Crawlid: '{id}' Appid: '{appid}' expired"
                                  .format(appid=req_dict['meta']['appid'],
                                          id=req_dict['meta']['crawlid']))
        else:
            self.logger.debug("Crawlid: '{id}' Appid: '{appid}' blacklisted"
                              .format(appid=req_dict['meta']['appid'],
                                      id=req_dict['meta']['crawlid']))
1286727
function request (event, data) {
    return new Promise(function (resolve, reject) {
      // put the data in an envelope with id
      var id = getId();
      var envelope = {
        event: event,
        id: id,
        data: data
      };

      // add the request to the list with requests in progress
      queue[id] = {
        resolve: resolve,
        reject: reject,
        timeout: setTimeout(function () {
          delete queue[id];
          reject(new Error('Timeout'));
        }, TIMEOUT)
      };

      debug('request', envelope);
      socket.send(JSON.stringify(envelope));
    }).catch(function (err) {console.log('ERROR', err)});
  }
931480
def add_request(self, request):
        

        queue_item = QueueItem(request, Response(request.url))
        self.add(queue_item)
        return queue_item
169035
function reqId (req) {
  return [ req.params.service, fp.parseNil(req.params.id) ];
}
132241
void awaitRequests() {
        if (!isWaitingForEnriching()) {
            return;
        }
        for (int i = 0; i < NUMBER_OF_WAIT_LOOPS; i++) {
            try {
                Thread.sleep(THREAD_SLEEP);
                if (!isEnrichmentAdvertised()) {
                    return;
                }
            } catch (InterruptedException e) {
                throw new IllegalStateException(e);
            }
        }
        throw new SettingRequestTimeoutException();
    }
49022
def requeue(self):
        
        if self.acknowledged:
            raise self.MessageStateError(
                "Message already acknowledged with state: %s" % self._state)
        self.backend.requeue(self.delivery_tag)
        self._state = "REQUEUED"
1286921
ServerRequest peek() {
        ServerRequest req = null;
        synchronized (reqQueueLockObject) {
            try {
                req = queue.get(0);
            } catch (IndexOutOfBoundsException | NoSuchElementException ignored) {
            }
        }
        return req;
    }
771382
def queue(self, queue, message, params={}, uids=[]):
        

        d = {
            'id': uuid.uuid1().get_hex(),
            'version': 1,
            'message': message,
            'params': params
        }

        ser = json.dumps(d)
        
        if uids:
            for uid in uids:
                path = '/dq/%s/%s' % (uid, queue)
                yield self._put_queue(path, ser)

        else:
            path = '/q/%s' % queue
            yield self._put_queue(path, ser)

        defer.returnValue(d['id'])
356591
function queue(args) {
    args.push(resultsCallback);
    stack.push({caller: this.caller, args: args});
  }
1140475
function (i)
    {
        var req = this._requests[i];
        if (req.dead === null) {
            req.dead = new Date();
        }

        this._processRequest(i);
    }
1296651
function JobQueue(para) {
	this.queue = [];
	this.curr = 0;
	this.all_passed = true;
	this.timeout = ((typeof para === 'object' && typeof para.timeout === 'number') ? para.timeout : 0);
}
1336057
function(template, options) {
	queue = apostle.createQueue();
	queue.push(template, options);
	return queue.deliver();
}
864979
void deliver(final OtpMsg m) {
        switch (m.type()) {
        case OtpMsg.linkTag:
            links.addLink(self, m.getSenderPid());
            break;

        case OtpMsg.unlinkTag:
            links.removeLink(self, m.getSenderPid());
            break;

        case OtpMsg.exitTag:
            links.removeLink(self, m.getSenderPid());
            queue.put(m);
            break;

        case OtpMsg.exit2Tag:
        default:
            queue.put(m);
            break;
        }
    }
414696
def data_received(self, data):
        """"""
        if self._on_data:
            self._on_data(data)
            return
        self._queued_data.append(data)