PHP Class Predis\PubSub\DispatcherLoop

Author: Daniele Alessandri ([email protected])
Afficher le fichier Open project: nrk/predis Class Usage Examples

Protected Properties

Свойство Type Description
$callbacks
$defaultCallback
$subscriptionCallback

Méthodes publiques

Méthode Description
__construct ( Consumer $pubsub )
attachCallback ( string $channel, callable $callback ) Binds a callback to a channel.
defaultCallback ( mixed $callable = null ) Sets a callback that gets invoked when a message is received on a channel that does not have an associated callback.
detachCallback ( string $channel ) Stops listening to a channel and removes the associated callback.
getPubSubConsumer ( ) : Consumer Returns the underlying PUB / SUB context.
run ( ) Starts the dispatcher loop.
stop ( ) Terminates the dispatcher loop.
subscriptionCallback ( mixed $callable = null ) Sets a callback that gets invoked upon new subscriptions.

Méthodes protégées

Méthode Description
assertCallback ( mixed $callable ) Checks if the passed argument is a valid callback.
getPrefixKeys ( ) : string Return the prefix used for keys.

Method Details

__construct() public méthode

public __construct ( Consumer $pubsub )
$pubsub Consumer PubSub consumer instance used by the loop.

assertCallback() protected méthode

Checks if the passed argument is a valid callback.
protected assertCallback ( mixed $callable )
$callable mixed A callback.

attachCallback() public méthode

Binds a callback to a channel.
public attachCallback ( string $channel, callable $callback )
$channel string Channel name.
$callback callable A callback.

defaultCallback() public méthode

Sets a callback that gets invoked when a message is received on a channel that does not have an associated callback.
public defaultCallback ( mixed $callable = null )
$callable mixed A callback.

detachCallback() public méthode

Stops listening to a channel and removes the associated callback.
public detachCallback ( string $channel )
$channel string Redis channel.

getPrefixKeys() protected méthode

Return the prefix used for keys.
protected getPrefixKeys ( ) : string
Résultat string

getPubSubConsumer() public méthode

Returns the underlying PUB / SUB context.
public getPubSubConsumer ( ) : Consumer
Résultat Consumer

run() public méthode

Starts the dispatcher loop.
public run ( )

stop() public méthode

Terminates the dispatcher loop.
public stop ( )

subscriptionCallback() public méthode

Sets a callback that gets invoked upon new subscriptions.
public subscriptionCallback ( mixed $callable = null )
$callable mixed A callback.

Property Details

$callbacks protected_oe property

protected $callbacks

$defaultCallback protected_oe property

protected $defaultCallback

$subscriptionCallback protected_oe property

protected $subscriptionCallback