PHP Class Predis\PubSub\AbstractConsumer

Author: Daniele Alessandri ([email protected])
Inheritance: implements Iterator
Afficher le fichier Open project: tillkruss/redis-object-cache

Méthodes publiques

Méthode Description
__destruct ( ) Automatically stops the consumer when the garbage collector kicks in.
current ( ) : array Returns the last message payload retrieved from the server and generated by one of the active subscriptions.
key ( )
next ( )
ping ( string $payload = null ) PING the server with an optional payload that will be echoed as a PONG message in the pub/sub loop.
psubscribe ( $pattern ) Subscribes to the specified channels using a pattern.
punsubscribe ( ) Unsubscribes from the specified channels using a pattern.
rewind ( )
stop ( boolean $drop = false ) : boolean Closes the context by unsubscribing from all the subscribed channels. The context can be forcefully closed by dropping the underlying connection.
subscribe ( $channel ) Subscribes to the specified channels.
unsubscribe ( ) Unsubscribes from the specified channels.
valid ( ) : boolean Checks if the the consumer is still in a valid state to continue.

Méthodes protégées

Méthode Description
disconnect ( ) Closes the underlying connection when forcing a disconnection.
getValue ( ) : array Waits for a new message from the server generated by one of the active subscriptions and returns it when available.
invalidate ( ) Resets the state of the consumer.
isFlagSet ( integer $value ) : boolean Checks if the specified flag is valid based on the state of the consumer.
writeRequest ( string $method, array $arguments ) Writes a Redis command on the underlying connection.

Method Details

__destruct() public méthode

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

current() public méthode

Returns the last message payload retrieved from the server and generated by one of the active subscriptions.
public current ( ) : array
Résultat array

disconnect() abstract protected méthode

Closes the underlying connection when forcing a disconnection.
abstract protected disconnect ( )

getValue() abstract protected méthode

Waits for a new message from the server generated by one of the active subscriptions and returns it when available.
abstract protected getValue ( ) : array
Résultat array

invalidate() protected méthode

Resets the state of the consumer.
protected invalidate ( )

isFlagSet() protected méthode

Checks if the specified flag is valid based on the state of the consumer.
protected isFlagSet ( integer $value ) : boolean
$value integer Flag.
Résultat boolean

key() public méthode

public key ( )

next() public méthode

public next ( )

ping() public méthode

PING the server with an optional payload that will be echoed as a PONG message in the pub/sub loop.
public ping ( string $payload = null )
$payload string Optional PING payload.

psubscribe() public méthode

Subscribes to the specified channels using a pattern.
public psubscribe ( $pattern )

punsubscribe() public méthode

Unsubscribes from the specified channels using a pattern.
public punsubscribe ( )

rewind() public méthode

public rewind ( )

stop() public méthode

Closes the context by unsubscribing from all the subscribed channels. The context can be forcefully closed by dropping the underlying connection.
public stop ( boolean $drop = false ) : boolean
$drop boolean Indicates if the context should be closed by dropping the connection.
Résultat boolean Returns false when there are no pending messages.

subscribe() public méthode

Subscribes to the specified channels.
public subscribe ( $channel )

unsubscribe() public méthode

Unsubscribes from the specified channels.
public unsubscribe ( )

valid() public méthode

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

writeRequest() abstract protected méthode

Writes a Redis command on the underlying connection.
abstract protected writeRequest ( string $method, array $arguments )
$method string Command ID.
$arguments array Arguments for the command.