PHP Class Predis\Collection\Iterator\ListKey

This iterator tries to emulate the behaviour of cursor-based iterators based on the SCAN-family of commands introduced in Redis <= 2.8, meaning that due to its incremental nature with multiple fetches it can only offer limited guarantees on the returned elements because the collection can change several times (trimmed, deleted, overwritten) during the iteration process.
Author: Daniele Alessandri ([email protected])
Inheritance: implements Iterator
Afficher le fichier Open project: nrk/predis Class Usage Examples

Protected Properties

Свойство Type Description
$client
$count
$current
$elements
$fetchmore
$key
$position
$valid

Méthodes publiques

Méthode Description
__construct ( Predis\ClientInterface $client, string $key, integer $count = 10 )
current ( )
key ( )
next ( )
rewind ( )
valid ( )

Méthodes protégées

Méthode 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.
requiredCommand ( Predis\ClientInterface $client, string $commandID ) Ensures that the client instance 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 méthode

public __construct ( Predis\ClientInterface $client, string $key, integer $count = 10 )
$client Predis\ClientInterface Client connected to Redis.
$key string Redis list key.
$count integer Number of items retrieved on each fetch operation.

current() public méthode

public current ( )

executeCommand() protected méthode

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

extractNext() protected méthode

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

fetch() protected méthode

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

key() public méthode

public key ( )

next() public méthode

public next ( )

requiredCommand() protected méthode

Ensures that the client instance 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 méthode

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

rewind() public méthode

public rewind ( )

valid() public méthode

public valid ( )

Property Details

$client protected_oe property

protected $client

$count protected_oe property

protected $count

$current protected_oe property

protected $current

$elements protected_oe property

protected $elements

$fetchmore protected_oe property

protected $fetchmore

$key protected_oe property

protected $key

$position protected_oe property

protected $position

$valid protected_oe property

protected $valid