protected function writeCapped(array $record)
    {
        if ($this->redisClient instanceof \Redis) {
            $this->redisClient->multi()
                ->rpush($this->redisKey, $record["formatted"])
                ->ltrim($this->redisKey, -$this->capSize, -1)
                ->exec();
        } else {
            $redisKey = $this->redisKey;
            $capSize = $this->capSize;
            $this->redisClient->transaction(function ($tx) use ($record, $redisKey, $capSize) {
                $tx->rpush($redisKey, $record["formatted"]);
                $tx->ltrim($redisKey, -$capSize, -1);
            });
        }
    }
protected function writeCapped(array $record)
    {
        if ($this->redisClient instanceof \Redis) {
            $this->redisClient->multi()
                ->rpush($this->redisKey, $record["formatted"])
                ->ltrim($this->redisKey, -$this->capSize, -1)
                ->exec();
        } else {
            $redisKey = $this->redisKey;
            $capSize = $this->capSize;
            $this->redisClient->transaction(function ($tx) use ($record, $redisKey, $capSize) {
                $tx->rpush($redisKey, $record["formatted"]);
                $tx->ltrim($redisKey, -$capSize, -1);
            });
        }
    }
protected function writeCapped ( array $ record ) { if ( $ this -> redisClient instanceof \ Redis ) { $ this -> redisClient -> multi ( ) -> rpush ( $ this -> redisKey , $ record [ "formatted" ] ) -> ltrim ( $ this -> redisKey , - $ this -> capSize , - 1 ) -> exec ( ) ; } else { $ redisKey = $ this -> redisKey ; $ capSize = $ this -> capSize ; $ this -> redisClient -> transaction ( function ( $ tx ) use ( $ record , $ redisKey , $ capSize ) { $ tx -> rpush ( $ redisKey , $ record [ "formatted" ] ) ; $ tx -> ltrim ( $ redisKey , - $ capSize , - 1 ) ; } ) ; } }
Write and cap the collection
Writes the record to the redis list and caps its

@param  array $record associative record array
@return void
Write and cap the collection Writes the record to the redis list and caps its