PHP Class Predis\Collection\Iterator\CursorBasedIterator

Given their incremental nature with multiple fetches, these kind of iterators offer limited guarantees about the returned elements because the collection can change several times during the iteration process.
See also: http://redis.io/commands/scan
Author: Daniele Alessandri ([email protected])
Inheritance: implements Iterator
Show file Open project: nrk/predis Class Usage Examples

Protected Properties

Property Type Description
$client
$count
$current
$cursor
$elements
$fetchmore
$match
$position
$valid

Public Methods

Method Description
__construct ( Predis\ClientInterface $client, string $match = null, integer $count = null )
current ( )
key ( )
next ( )
rewind ( )
valid ( )

Protected Methods

Method Description
executeCommand ( ) : array Fetches a new set of elements from the remote collection, effectively advancing the iteration process.
extractNext ( ) Extracts next values for key() and current().
fetch ( ) Populates the local buffer of elements fetched from the server during the iteration.
getScanOptions ( ) : array Returns an array of options for the SCAN command.
requiredCommand ( Predis\ClientInterface $client, string $commandID ) Ensures that the client supports the specified Redis command required to fetch elements from the server to perform the iteration.
reset ( ) Resets the inner state of the iterator.

Method Details

__construct() public method

public __construct ( Predis\ClientInterface $client, string $match = null, integer $count = null )
$client Predis\ClientInterface Client connected to Redis.
$match string Pattern to match during the server-side iteration.
$count integer Hint used by Redis to compute the number of results per iteration.

current() public method

public current ( )

executeCommand() abstract protected method

Fetches a new set of elements from the remote collection, effectively advancing the iteration process.
abstract protected executeCommand ( ) : array
return array

extractNext() protected method

Extracts next values for key() and current().
protected extractNext ( )

fetch() protected method

Populates the local buffer of elements fetched from the server during the iteration.
protected fetch ( )

getScanOptions() protected method

Returns an array of options for the SCAN command.
protected getScanOptions ( ) : array
return array

key() public method

public key ( )

next() public method

public next ( )

requiredCommand() protected method

Ensures that the client supports the specified Redis command required to fetch elements from the server to perform the iteration.
protected requiredCommand ( Predis\ClientInterface $client, string $commandID )
$client Predis\ClientInterface Client connected to Redis.
$commandID string Command ID.

reset() protected method

Resets the inner state of the iterator.
protected reset ( )

rewind() public method

public rewind ( )

valid() public method

public valid ( )

Property Details

$client protected property

protected $client

$count protected property

protected $count

$current protected property

protected $current

$cursor protected property

protected $cursor

$elements protected property

protected $elements

$fetchmore protected property

protected $fetchmore

$match protected property

protected $match

$position protected property

protected $position

$valid protected property

protected $valid