PHP Class Predis\Monitor\Consumer

Author: Daniele Alessandri ([email protected])
Inheritance: implements Iterato\Iterator
Datei anzeigen Open project: nrk/predis Class Usage Examples

Public Methods

Method Description
__construct ( Predis\ClientInterface $client )
__destruct ( ) Automatically stops the consumer when the garbage collector kicks in.
current ( ) : object Returns the last message payload retrieved from the server.
key ( )
next ( )
rewind ( )
stop ( ) Stops the consumer. Internally this is done by disconnecting from server since there is no way to terminate the stream initialized by MONITOR.
valid ( ) : boolean Checks if the the consumer is still in a valid state to continue.

Protected Methods

Method Description
start ( ) Initializes the consumer and sends the MONITOR command to the server.

Private Methods

Method Description
assertClient ( Predis\ClientInterface $client ) 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.

Method Details

__construct() public method

public __construct ( Predis\ClientInterface $client )
$client Predis\ClientInterface Client instance used by the consumer.

__destruct() public method

Automatically stops the consumer when the garbage collector kicks in.
public __destruct ( )

current() public method

Returns the last message payload retrieved from the server.
public current ( ) : object
return object

key() public method

public key ( )

next() public method

public next ( )

rewind() public method

public rewind ( )

start() protected method

Initializes the consumer and sends the MONITOR command to the server.
protected start ( )

stop() public method

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 ( )

valid() public method

Checks if the the consumer is still in a valid state to continue.
public valid ( ) : boolean
return boolean