private boolean stopPeekingDueToTime(int timeToWait, long end) {
    final boolean isDebugEnabled = logger.isDebugEnabled();
    // If time to wait is -1 (don't wait) or time interval has elapsed
    long currentTime = System.currentTimeMillis();
    if (isDebugEnabled) {
      logger.debug("{}: Peek current time: {}", this, currentTime);
    }
    if (timeToWait == -1 || (end <= currentTime)) {
      if (isDebugEnabled) {
        logger.debug("{}: Peek breaking", this);
      }
      return true;
    }
    return false;
  }
Take will choose a random BucketRegionQueue which is primary and will take the head element
from it.
geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java