APIs in the PubSubUtils class
Use the APIs in the PubSubUtils class to publish and subscribe to events.
- cleanContextSubscribers(contextName)
Deletes the subscription items of all events under the given context.
- publish(eventType, payload)
Invokes all items subscribed to a specific type of event and passes the specified payload to the subscribed items.
- subscribe(eventType, subscriptionItem, subscriptionItemName, subscribeOnce, contextName)
Notifies a subscription item whenever an event occurs in a specific context.
- subscribeOnce(eventType, subscriptionItem, subscriptionItemName)
Notifies the subscription item only once when a specific type of event occurs.
- unsubscribe(eventType, subscriptionItemName, contextName)
Unsubscribes a subscription item belonging to a specific type of event.
Previous topic updatePersonalization(listID, personalizationID, personalizedState) Next topic cleanContextSubscribers(contextName)