Predis\Client::pipeline PHP Method

pipeline() public method

Creates a new pipeline context and returns it, or returns the results of a pipeline executed inside the optionally provided callable object.
public pipeline ( ) : Pipeline | array
return Predis\Pipeline\Pipeline | array
    public function pipeline()
    {
        return $this->sharedContextFactory('createPipeline', func_get_args());
    }

Usage Example

 public function markUserOnline($pageKey, $userIdent)
 {
     $thisMinute = floor(time() / 60) * 60;
     $key = $this->makeUsersOnlineKey($pageKey, $thisMinute);
     $this->redis->pipeline(function (Pipeline $p) use($key, $userIdent) {
         $p->sadd($key, $userIdent);
         $p->expire($key, self::ONLINE_MINUTES * 60);
     });
 }
All Usage Examples Of Predis\Client::pipeline