PHP Class Horde_PubSub, horde

Afficher le fichier Open project: horde/horde Class Usage Examples

Protected Properties

Свойство Type Description
$_topics Subscribed topics and their handles

Méthodes publiques

Méthode Description
clearHandles ( string $topic ) : void Clear all handlers for a given topic
getSubscribedHandles ( string $topic ) : array Retrieve all handlers for a given topic
getTopics ( ) : array Retrieve all registered topics
publish ( string $topic, mixed $args = null ) : void Publish to all handlers for a given topic
subscribe ( string $topic, string | object $context, null | string $handler = null ) : Horde_PubSub_Handle Subscribe to a topic
unsubscribe ( Horde_PubSub_Handle $handle ) : boolean Unsubscribe a handler from a topic

Method Details

clearHandles() public static méthode

Clear all handlers for a given topic
public static clearHandles ( string $topic ) : void
$topic string
Résultat void

getSubscribedHandles() public static méthode

Retrieve all handlers for a given topic
public static getSubscribedHandles ( string $topic ) : array
$topic string
Résultat array Array of Horde_PubSub_Handle objects

getTopics() public static méthode

Retrieve all registered topics
public static getTopics ( ) : array
Résultat array

publish() public static méthode

Publish to all handlers for a given topic
public static publish ( string $topic, mixed $args = null ) : void
$topic string
$args mixed All arguments besides the topic are passed as arguments to the handler
Résultat void

subscribe() public static méthode

Subscribe to a topic
public static subscribe ( string $topic, string | object $context, null | string $handler = null ) : Horde_PubSub_Handle
$topic string
$context string | object Function name, class name, or object instance
$handler null | string If $context is a class or object, the name of the method to call
Résultat Horde_PubSub_Handle Pub-Sub handle (to allow later unsubscribe)

unsubscribe() public static méthode

Unsubscribe a handler from a topic
public static unsubscribe ( Horde_PubSub_Handle $handle ) : boolean
$handle Horde_PubSub_Handle
Résultat boolean Returns true if topic and handle found, and unsubscribed; returns false if either topic or handle not found

Property Details

$_topics protected_oe static_oe property

Subscribed topics and their handles
protected static $_topics