public interface PubSubService
This service allows cross-instance notifications through simple messages sent to topics.
| Modifier and Type | Method and Description |
|---|---|
void |
publish(String topic,
byte[] message)
Publishes a message to the given topic.
|
void |
registerSubscriber(String topic,
BiConsumer<String,byte[]> subscriber)
Registers a subscriber for the given topic.
|
void |
unregisterSubscriber(String topic,
BiConsumer<String,byte[]> subscriber)
Unregisters a subscriber for the given topic.
|
void publish(String topic, byte[] message)
topic - the topicmessage - the messagevoid registerSubscriber(String topic, BiConsumer<String,byte[]> subscriber)
The subscriber must deal with the message without delay and return immediately, usually by storing it in a thread-safe datastructure.
topic - the topicsubscriber - the subscriber, who will receive the topic and a byte[] messagevoid unregisterSubscriber(String topic, BiConsumer<String,byte[]> subscriber)
topic - the topicsubscriber - the subscriberCopyright © 2018 Nuxeo. All rights reserved.