Documentation

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
author

Daniele Alessandri suppakilla@gmail.com

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

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

getPosition()

Returns the current position of the iterator.

public getPosition() : int
Return values
int

getValue()

{@inheritdoc}

protected abstract getValue() : mixed
Return values
mixed

Search results