public function pending($name)
    {
        $length = $this->connection()->llen('commands:'.$name);

        if ($length < 1) {
            return [];
        }

        $results = $this->connection()->pipeline(function ($pipe) use ($name, $length) {
            $pipe->lrange('commands:'.$name, 0, $length - 1);

            $pipe->ltrim('commands:'.$name, $length, -1);
        });

        return collect($results[0])->map(function ($result) {
            return (object) json_decode($result, true);
        })->all();
    }
public function pending($name)
    {
        $length = $this->connection()->llen('commands:'.$name);

        if ($length < 1) {
            return [];
        }

        $results = $this->connection()->pipeline(function ($pipe) use ($name, $length) {
            $pipe->lrange('commands:'.$name, 0, $length - 1);

            $pipe->ltrim('commands:'.$name, $length, -1);
        });

        return collect($results[0])->map(function ($result) {
            return (object) json_decode($result, true);
        })->all();
    }
public function pending ( $ name ) { $ length = $ this -> connection ( ) -> llen ( 'commands:' . $ name ) ; if ( $ length < 1 ) { return [ ] ; } $ results = $ this -> connection ( ) -> pipeline ( function ( $ pipe ) use ( $ name , $ length ) { $ pipe -> lrange ( 'commands:' . $ name , 0 , $ length - 1 ) ; $ pipe -> ltrim ( 'commands:' . $ name , $ length , - 1 ) ; } ) ; return collect ( $ results [ 0 ] ) -> map ( function ( $ result ) { return ( object ) json_decode ( $ result , true ) ; } ) -> all ( ) ; }
Get the pending commands for a given queue name.

@param  string  $name
@return array
Get the pending commands for a given queue name .