limit traffic
@return if true
426728
public boolean limit() {

        //get connection
        Object connection = getConnection();

        Object result = limitRequest(connection);

        if (FAIL_CODE != (Long) result) {
            return true;
        } else {
            return false;
        }
    }
1176262
final boolean abort() {
        if (!taken.get()) {
            // aborting always runs before connection
            // happens. If we reach this point the request
            // can be active or suspended
            // but nor delivered or committed
            result = BaasResult.cancel();
            // we can simply forcefully set the value
            // to ABORTED to let the resource been cleaned up
            suspendableHandler.set(Signal.ABORTED);
            finish();
            return true;
        }
        return false;
    }
534522
private boolean isWorkAvailable() throws SIConnectionDroppedException {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isWorkAvailable");
      final boolean isWork;
      if (terminate) {
         isWork = false;
      } else {
         isWork = (partiallySentTransmission != null) || !priorityQueue.isEmpty();
      }
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "isWorkAvailable", Boolean.valueOf(isWork));
      return isWork;
   }
512436
@Override
    public void registerLimit(final long limit) {

        if (queues.size() > 0) {
            if (unlimited.get(currentQueue())
                         .get())
                limits.get(currentQueue())
                      .set(0);

            limits.get(currentQueue())
                  .addAndGet(limit);
            unlimited.get(currentQueue())
                     .set(false);

            queues.stream()
                  .forEach(this::closeQueueIfFinishedStateless);

        }
    }
1304270
private boolean isTilingViewAllowed() {

        if (m_types.size() == 0) {
            return false;
        }
        for (String typeName : m_types) {
            if (!isImagelikeType(typeName)) {
                return false;
            }
        }
        return true;

    }
534932
public void setLimits(int maxConPerRoute, int maxConTotal) {
        this.maxConnPerRoute = maxConPerRoute;
        this.maxConnTotal = maxConTotal;
        if ( asyncHttpClient != null ) {
            try {
                asyncHttpClient.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
            asyncHttpClient = null;
        }
    }
651466
@Override
    public boolean isSendAllowed()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "isSendAllowed");

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "isSendAllowed", new Boolean(_isSendAllowed));

        return _isSendAllowed;
    }
700011
boolean isKeepaliveAllowed(long connectionStartTime)
  {
    if (! _lifecycle.isActive()) {
      return false;
    }
    else if (connectionStartTime + _keepaliveTimeMax < CurrentTime.currentTime()) {
      return false;
    }
    else if (_keepaliveMax <= _keepaliveAllocateCount.get()) {
      return false;
    }
    /*
    else if (_connThreadPool.isThreadMax()
             && _connThreadPool.isIdleLow()
             && ! isKeepaliveAsyncEnabled()) {
      return false;
    }
    */
    else {
      return true;
    }
  }
178762
def limit(self, limit):
        
        if self._limit != limit:
            self.dirty = True
            self._limit = limit
        return self
14580
public synchronized boolean isRateLimited() {
        final double rate = TOKEN_BUCKET_RATE.get();
        final double window = TOKEN_BUCKET_WINDOW.get();
        final long current = System.currentTimeMillis();
        final double timePassed = current - tkBktLastCheckTime;

        tkBktLastCheckTime = current;
        tkBktAllowance = tkBktAllowance + timePassed * (rate / window);

        if (tkBktAllowance > rate) {
            tkBktAllowance = rate; //cap max to rate
        }

        if (tkBktAllowance < 1.0) {
            return true;
        }

        tkBktAllowance = tkBktAllowance - 1.0;
        return false;
    }
1091747
public R setLimit(int limit) {
        mQueryMap.put(LIMIT, String.valueOf(limit));
        return (R) this;
    }
713463
public boolean isSendAllowed()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "isSendAllowed");
    
    boolean isSendAllowed = aliasDest.isSendAllowed();
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "isSendAllowed", new Boolean(isSendAllowed));
    
    return isSendAllowed;
  }
298565
public synchronized boolean stopServer() {

        if (!isProxyRunning) {
            return false;
        }

        isProxyRunning = false;
        HttpUtil.closeServerSocket(proxySocket);

        try {
            thread.join();   //(PORT_TIME_OUT);
            
        } catch (Exception e) {
        }

        proxySocket = null;

        return true;
    }
533173
@Override
    public boolean canLeave() {
      if (reached == 0) {
        return false;
      }
      if (namesystem.now() - reached < extension) {
        reportStatus("STATE* Safe mode ON.", false);
        return false;
      }
      return !needEnter();
    }
54890
public CommunicationServiceBuilder limit(String socketName, Integer rate) {
      return limit(socketName, rate, rate);
   }
188590
public function limit() {
        $args = func_get_args();
        $this->build()->bindExpression('limit', $args[0] . " " . (empty($args[1]) ? '' : ",{$args[1]}"));

        return $this->connection;
    }
230854
@Override
    public boolean stop() {
        synchronized(MetricCollectorSupport.class) {
            if (uploaderThread != null) {
                uploaderThread.cancel();
                uploaderThread.interrupt();
                uploaderThread = null;
                if (singleton == this) { // defensive check
                    singleton = null;
                }
                return true;
            }
        }
        return false;
    }