Add a request to the list of pending
@param req the request to add
964552
private void addPendingRequest(ResourceRequestInfo req) {
    idToPendingRequests.put(req.getId(), req);
    if (req.getHosts() != null && req.getHosts().size() > 0) {
      Context c = getContext(req.getType());
      for (RequestedNode node: req.getRequestedNodes()) {
        String host = node.getHost();
        List<ResourceRequestInfo> hostReqs = c.hostToPendingRequests.get(host);
        if (hostReqs == null) {
          hostReqs = new LinkedList<ResourceRequestInfo>();
          c.hostToPendingRequests.put(host, hostReqs);
        }
        hostReqs.add(req);
        Node rack = node.getRack();
        List<ResourceRequestInfo> rackReqs = c.rackToPendingRequests.get(rack);
        if (rackReqs == null) {
          rackReqs = new LinkedList<ResourceRequestInfo>();
          c.rackToPendingRequests.put(rack, rackReqs);
        }
        rackReqs.add(req);
      }
    }
    // Always add to the "any" list.
    Context c = getContext(req.getType());
    c.anyHostRequests.add(req);
    addPendingRequestForType(req);
  }
117132
public void request(List<org.apache.mesos.v1.Protos.Request> requests) {
    Builder request = build().setRequest(Request.newBuilder().addAllRequests(requests));
    sendCall(request, Type.REQUEST);
  }
508047
public void addRequest(RecordRequest request) {
        if (request.getRequestSize() + getRequestSize() > 248) {
            throw new IllegalArgumentException();
        }

        if (records == null) {
            records = new RecordRequest[1];
        }
        else {
            RecordRequest old[] = records;
            records = new RecordRequest[old.length + 1];

            System.arraycopy(old, 0, records, 0, old.length);
        }
        records[records.length - 1] = request;

        setDataLength(getRequestSize());
    }
82144
private void addPostParams(final Request request) {
        if (friendlyName != null) {
            request.addPostParam("FriendlyName", friendlyName);
        }

        if (status != null) {
            request.addPostParam("Status", status.toString());
        }
    }
1133947
private void addPostParams(final Request request) {
        if (code != null) {
            request.addPostParam("Code", code);
        }

        if (to != null) {
            request.addPostParam("To", to);
        }
    }
100443
def send_request(req)
      raise StateError, "Tried to send a request while one is pending already. Make sure you read off the body." if @pending_response
      raise StateError, "Tried to send a request while a response is pending. Make sure you read off the body."  if @pending_request

      @pending_request = true

      req.stream @socket

      @pending_response = true
      @pending_request  = false
    end
1175229
<T> void finish(Request<T> request) {
        // Remove from the set of requests currently being processed.
        synchronized (currentRequests) {
            currentRequests.remove(request);
        }
        if (request.shouldCache()) {
            synchronized (waitingRequests) {
                String cacheKey = request.getCacheKey();
                Queue<Request<?>> waitingRequests = this.waitingRequests.remove(cacheKey);
                if (waitingRequests != null) {
                    //todo add queue markers
//                    if (JusLog.DEBUG) {
//                        JusLog.v("Releasing %d waiting requests for cacheKey=%s.",
//                                waitingRequests.size(), cacheKey);
//                    }
                    // Process all queued up requests. They won't be considered as in flight, but
                    // that's not a problem as the cache has been primed by 'request'.
                    cacheQueue.addAll(waitingRequests);
                }
            }
        }
    }
753825
public void addRequirement(String requirement) {
		if (!Strings.isEmpty(requirement)) {
			if (this.requirements == null) {
				this.requirements = new ArrayList<>();
			}
			this.requirements.add(requirement);
		}
	}
1150408
def add(self, req: Request):
        
        key = req.key
        if key not in self:
            self[key] = ReqState(req)
        return self[key]
1056121
public synchronized void addChangeRequests(List<T> requests)
  {
    for (T request : requests) {
      changes.add(new Holder<>(request, getLastCounter().inc()));
    }

    singleThreadedExecutor.execute(resolveWaitingFuturesRunnable);
  }
387612
protected void sendRequests() {
        if ( ! requestUnderway ) {
            requestUnderway = true;
            delayed( new Runnable() {
                @Override
                public void run() {
                    synchronized (requests) {
                        Object req[];
                        if ( openFutureRequests.get() > 0 && requests.size() == 0 ) {
                            req = new Object[] { "SP", lastSeenSeq };
                        } else {
                            req = new Object[requests.size() + 1];
                            for (int i = 0; i < requests.size(); i++) {
                                req[i] = requests.get(i);
                            }
                            req[req.length - 1] = lastSeenSeq;
                            requests.clear();
                        }

                        sendCallArray(req).then(new Callback<Integer>() {
                            @Override
                            public void receive(Integer result, Object error) {
                                synchronized (requests ) {
                                    requestUnderway = false;
                                    if ( requests.size() > 0 || (result != null && result > 0 && openFutureRequests.get() > 0 ) ) {
                                        myExec.execute(new Runnable() {
                                            @Override
                                            public void run() {
                                            sendRequests();
                                            }
                                        });
                                    }
                                }
                            }
                        });
                    }
                }
            }, 1);
        }
    }
457653
private void addQueryParams(final Request request) {
        if (device != null) {
            request.addQueryParam("Device", device);
        }

        if (sim != null) {
            request.addQueryParam("Sim", sim);
        }

        if (status != null) {
            request.addQueryParam("Status", status);
        }

        if (direction != null) {
            request.addQueryParam("Direction", direction);
        }

        if (getPageSize() != null) {
            request.addQueryParam("PageSize", Integer.toString(getPageSize()));
        }
    }
795580
def _add_request_entry(self, entry=()):
        
        if not self._lookup_request_entry(entry):
            self.request_entry.append(entry)
361293
public void attach(RequestIdentifier reqID, JainMgcpListener listener) {
        this.requestListeners.put(reqID.toString().trim(), listener);
    }
818047
private void addQueryParams(final Request request) {
        if (order != null) {
            request.addQueryParam("Order", order.toString());
        }

        if (from != null) {
            request.addQueryParam("From", from);
        }

        if (bounds != null) {
            request.addQueryParam("Bounds", bounds.toString());
        }

        if (getPageSize() != null) {
            request.addQueryParam("PageSize", Integer.toString(getPageSize()));
        }
    }
199816
public void setRequest(ModbusRequest req) {
        request = req;
        if (req != null) {
            request.setTransactionID(getTransactionID());
        }
    }
211165
private void addPostParams(final Request request) {
        if (key != null) {
            request.addPostParam("Key", key);
        }

        if (value != null) {
            request.addPostParam("Value", value);
        }
    }