Overview

Packages

  • PubSub

Classes

  • Horde_PubSub
  • Horde_PubSub_Handle
  • Horde_PubSub_Provider
  • Overview
  • Package
  • Class
  • Tree

Class Horde_PubSub

Publish-Subscribe system

Package: PubSub
Category: Horde
Located at Horde/PubSub.php
Methods summary
public static
# publish( string $topic, mixed $args = null )

Publish to all handlers for a given topic

Publish to all handlers for a given topic

Parameters

$topic
$args
All arguments besides the topic are passed as arguments to the handler
public static Horde_PubSub_Handle
# subscribe( string $topic, string|object $context, null|string $handler = null )

Subscribe to a topic

Subscribe to a topic

Parameters

$topic
$context
Function name, class name, or object instance
$handler
If $context is a class or object, the name of the method to call

Returns

Horde_PubSub_Handle
Pub-Sub handle (to allow later unsubscribe)
public static boolean
# unsubscribe( Horde_PubSub_Handle $handle )

Unsubscribe a handler from a topic

Unsubscribe a handler from a topic

Parameters

$handle

Returns

boolean
Returns true if topic and handle found, and unsubscribed; returns false if either topic or handle not found
public static array
# getTopics( )

Retrieve all registered topics

Retrieve all registered topics

Returns

array
public static array
# getSubscribedHandles( string $topic )

Retrieve all handlers for a given topic

Retrieve all handlers for a given topic

Parameters

$topic

Returns

array
Array of Horde_PubSub_Handle objects
public static
# clearHandles( string $topic )

Clear all handlers for a given topic

Clear all handlers for a given topic

Parameters

$topic
API documentation generated by ApiGen