Consumer
in package
implements
Iterator
Redis MONITOR consumer.
Tags
Interfaces, Classes and Traits
- Iterator
Table of Contents
- $client : mixed
- $position : mixed
- $valid : mixed
- __construct() : mixed
- __destruct() : mixed
- Automatically stops the consumer when the garbage collector kicks in.
- current() : object
- Returns the last message payload retrieved from the server.
- key() : mixed
- {@inheritdoc}
- next() : mixed
- {@inheritdoc}
- rewind() : mixed
- {@inheritdoc}
- stop() : mixed
- Stops the consumer. Internally this is done by disconnecting from server since there is no way to terminate the stream initialized by MONITOR.
- valid() : bool
- Checks if the the consumer is still in a valid state to continue.
- start() : mixed
- Initializes the consumer and sends the MONITOR command to the server.
- assertClient() : mixed
- Checks if the passed client instance satisfies the required conditions needed to initialize a monitor consumer.
- getValue() : object
- Waits for a new message from the server generated by MONITOR and returns it when available.
Properties
$client
private
mixed
$client
$position
private
mixed
$position
$valid
private
mixed
$valid
Methods
__construct()
public
__construct(ClientInterface $client) : mixed
Parameters
- $client : ClientInterface
-
Client instance used by the consumer.
Return values
mixed —__destruct()
Automatically stops the consumer when the garbage collector kicks in.
public
__destruct() : mixed
Return values
mixed —current()
Returns the last message payload retrieved from the server.
public
current() : object
Return values
object —key()
{@inheritdoc}
public
key() : mixed
Return values
mixed —next()
{@inheritdoc}
public
next() : mixed
Return values
mixed —rewind()
{@inheritdoc}
public
rewind() : mixed
Return values
mixed —stop()
Stops the consumer. Internally this is done by disconnecting from server since there is no way to terminate the stream initialized by MONITOR.
public
stop() : mixed
Return values
mixed —valid()
Checks if the the consumer is still in a valid state to continue.
public
valid() : bool
Return values
bool —start()
Initializes the consumer and sends the MONITOR command to the server.
protected
start() : mixed
Return values
mixed —assertClient()
Checks if the passed client instance satisfies the required conditions needed to initialize a monitor consumer.
private
assertClient(ClientInterface $client) : mixed
Parameters
- $client : ClientInterface
-
Client instance used by the consumer.
Tags
Return values
mixed —getValue()
Waits for a new message from the server generated by MONITOR and returns it when available.
private
getValue() : object