MultiBulkTuple
extends MultiBulk
in package
implements
OuterIterator
Outer iterator consuming streamable multibulk responses by yielding tuples of keys and values.
This wrapper is useful for responses to commands such as HGETALL
that can
be iterater as $key => $value pairs.
Tags
Interfaces, Classes and Traits
- OuterIterator
Table of Contents
- $current : mixed
- $position : mixed
- $size : mixed
- $connection : mixed
- $iterator : mixed
- __construct() : mixed
- __destruct() : mixed
- Handles the synchronization of the client with the Redis protocol when the garbage collector kicks in (e.g. when the iterator goes out of the scope of a foreach or it is unset).
- count() : int
- Returns the number of items comprising the whole multibulk response.
- current() : mixed
- {@inheritdoc}
- drop() : mixed
- Drop queued elements that have not been read from the connection either by consuming the rest of the multibulk response or quickly by closing the underlying connection.
- getInnerIterator() : mixed
- {@inheritdoc}
- getPosition() : int
- Returns the current position of the iterator.
- key() : mixed
- {@inheritdoc}
- next() : mixed
- {@inheritdoc}
- rewind() : mixed
- {@inheritdoc}
- valid() : mixed
- {@inheritdoc}
- checkPreconditions() : mixed
- Checks for valid preconditions.
- getValue() : mixed
- Reads the next item of the multibulk response from the connection.
Properties
$current
protected
mixed
$current
$position
protected
mixed
$position
$size
protected
mixed
$size
$connection
private
mixed
$connection
$iterator
private
mixed
$iterator
Methods
__construct()
public
__construct(MultiBulk $iterator) : mixed
Parameters
- $iterator : MultiBulk
-
Inner multibulk response iterator.
Return values
mixed —__destruct()
Handles the synchronization of the client with the Redis protocol when the garbage collector kicks in (e.g. when the iterator goes out of the scope of a foreach or it is unset).
public
__destruct() : mixed
Return values
mixed —count()
Returns the number of items comprising the whole multibulk response.
public
count() : int
This method should be used instead of iterator_count() to get the size of the current multibulk response since the former consumes the iteration to count the number of elements, but our iterators do not support rewinding.
Return values
int —current()
{@inheritdoc}
public
current() : mixed
Return values
mixed —drop()
Drop queued elements that have not been read from the connection either by consuming the rest of the multibulk response or quickly by closing the underlying connection.
public
drop([bool $disconnect = false ]) : mixed
Parameters
- $disconnect : bool = false
-
Consume the iterator or drop the connection.
Return values
mixed —getInnerIterator()
{@inheritdoc}
public
getInnerIterator() : mixed
Return values
mixed —getPosition()
Returns the current position of the iterator.
public
getPosition() : int
Return values
int —key()
{@inheritdoc}
public
key() : mixed
Return values
mixed —next()
{@inheritdoc}
public
next() : mixed
Return values
mixed —rewind()
{@inheritdoc}
public
rewind() : mixed
Return values
mixed —valid()
{@inheritdoc}
public
valid() : mixed
Return values
mixed —checkPreconditions()
Checks for valid preconditions.
protected
checkPreconditions(MultiBulk $iterator) : mixed
Parameters
- $iterator : MultiBulk
-
Inner multibulk response iterator.
Tags
Return values
mixed —getValue()
Reads the next item of the multibulk response from the connection.
protected
getValue() : mixed