Esempio n. 1
0
 public function appendValuesToList($key, $values)
 {
     $this->connectIfNeeded();
     foreach ($values as $value) {
         $this->redis->rPush($key, $value);
     }
     // usually we would simply do call_user_func_array(array($redis, 'rPush'), $values); as rpush supports multiple values
     // at once but it seems to be not implemented yet see https://github.com/nicolasff/phpredis/issues/366
     // doing it in one command should be much faster as it requires less tcp communication. Anyway, we currently do
     // not write multiple values at once ... so it is ok!
 }