public interface PublishSubscribeService
When an instance of this service is not available
then publish
is a no-op, a sink that discards all tuples on the stream.
A subscribe
will have no tuples when an instance of this service is not available.
Modifier and Type | Method and Description |
---|---|
<T> void |
addSubscriber(java.lang.String topic,
java.lang.Class<T> streamType,
Consumer<T> subscriber)
Add a subscriber to a published topic.
|
<T> Consumer<T> |
getPublishDestination(java.lang.String topic,
java.lang.Class<? super T> streamType)
Get the destination for a publisher.
|
void |
removeSubscriber(java.lang.String topic,
Consumer<?> subscriber) |
<T> void addSubscriber(java.lang.String topic, java.lang.Class<T> streamType, Consumer<T> subscriber)
T
- Tuple typetopic
- Topic to subscribe to.streamType
- Type of the stream.subscriber
- How to deliver published tuples to the subscriber.void removeSubscriber(java.lang.String topic, Consumer<?> subscriber)
<T> Consumer<T> getPublishDestination(java.lang.String topic, java.lang.Class<? super T> streamType)
destination.accept(tuple)
to publish
tuple
to the topic.T
- Tuple typetopic
- Topic tuples will be published to.streamType
- Type of the streamCopyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641