lib/Segment/QueueConsumer.php
public function flush() {
    $count = count($this->queue);
    $success = true;

    while ($count > 0 && $success) {
      $batch = array_splice($this->queue, 0, min($this->batch_size, $count));
      $success = $this->flushBatch($batch);

      $count = count($this->queue);
    }

    return $success;
  }
public function flush() {
    $count = count($this->queue);
    $success = true;

    while ($count > 0 && $success) {
      $batch = array_splice($this->queue, 0, min($this->batch_size, $count));
      $success = $this->flushBatch($batch);

      $count = count($this->queue);
    }

    return $success;
  }
public function flush ( ) { $ count = count ( $ this -> queue ) ; $ success = true ; while ( $ count > 0 && $ success ) { $ batch = array_splice ( $ this -> queue , 0 , min ( $ this -> batch_size , $ count ) ) ; $ success = $ this -> flushBatch ( $ batch ) ; $ count = count ( $ this -> queue ) ; } return $ success ; }
Flushes our queue of messages by batching them to the server
Flushes our queue of messages by batching them to the server