MultiBulkIterator
in package
implements
Iterator, Countable, ResponseInterface
Iterator that abstracts the access to multibulk responses allowing them to be consumed in a streamable fashion without keeping the whole payload in memory.
This iterator does not support rewinding which means that the iteration, once consumed, cannot be restarted.
Always make sure that the whole iteration is consumed (or dropped) to prevent protocol desynchronization issues.
Tags
Interfaces, Classes and Traits
- Iterator
- Countable
- ResponseInterface
- Represents a complex response object from Redis.
Table of Contents
- $current : mixed
- $position : mixed
- $size : mixed
- count() : int
- Returns the number of items comprising the whole multibulk response.
- current() : mixed
- {@inheritdoc}
- getPosition() : int
- Returns the current position of the iterator.
- key() : mixed
- {@inheritdoc}
- next() : mixed
- {@inheritdoc}
- rewind() : mixed
- {@inheritdoc}
- valid() : mixed
- {@inheritdoc}
- getValue() : mixed
- {@inheritdoc}
Properties
$current
protected
mixed
$current
$position
protected
mixed
$position
$size
protected
mixed
$size
Methods
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 —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 —getValue()
{@inheritdoc}
protected
abstract getValue() : mixed