public class ProviderPubSub extends java.lang.Object implements PublishSubscribeService
Constructor and Description |
---|
ProviderPubSub() |
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) |
public <T> void addSubscriber(java.lang.String topic, java.lang.Class<T> streamType, Consumer<T> subscriber)
PublishSubscribeService
addSubscriber
in interface PublishSubscribeService
T
- Tuple typetopic
- Topic to subscribe to.streamType
- Type of the stream.subscriber
- How to deliver published tuples to the subscriber.public <T> Consumer<T> getPublishDestination(java.lang.String topic, java.lang.Class<? super T> streamType)
PublishSubscribeService
destination.accept(tuple)
to publish
tuple
to the topic.getPublishDestination
in interface PublishSubscribeService
T
- Tuple typetopic
- Topic tuples will be published to.streamType
- Type of the streampublic void removeSubscriber(java.lang.String topic, Consumer<?> subscriber)
removeSubscriber
in interface PublishSubscribeService
Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641