search

goog.pubsub.PubSub

Provided By
Extends
All Implemented Interfaces

Topic-based publish/subscribe channel. Maintains a map of topics to subscriptions. When a message is published to a topic, all functions subscribed to that topic are invoked in the order they were added. Uncaught errors abort publishing.

Topics may be identified by any nonempty string, except strings corresponding to native Object properties, e.g. "constructor", "toString", "hasOwnProperty", etc.

new PubSub( opt_async )

Parameters
opt_asyncboolean=

Enable asynchronous behavior. Recommended for new code. See notes on the publish() method.

Instance Methods

Instance Properties