Interface Topics.ValueStream<V>
- Type Parameters:
V
- the value class
- All Superinterfaces:
Callback
,Stream
,Topics.SubscriberStream
- All Known Implementing Classes:
Topics.ValueStream.Default
- Enclosing interface:
- Topics
A stream implementation can be registered using
addStream
. The
stream will receive events for the topics that are selected by the topic
selector and have a compatible type.
A stream implementation can also be registered as a fallback stream using
addFallbackStream
.
Fallback streams will receive events for all topics that are not selected
by other streams the session has registered using addStream
.
If the stream is removed
,
onClose
will be called.
If the session is closed,
onError
will be called with ErrorReason.SESSION_CLOSED
.
See Topics
class documentation for further details of the use of
value streams.
- Since:
- 5.7
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
onValue
(String topicPath, TopicSpecification specification, V oldValue, V newValue) Notifies an update to a topic value from the server.Methods inherited from interface com.pushtechnology.diffusion.client.features.Topics.SubscriberStream
onSubscription, onUnsubscription
-
Method Details
-
onValue
Notifies an update to a topic value from the server.This is also called to provide the current value for any matching topic that the session is already subscribed to when the stream is added.
- Parameters:
topicPath
- the topic pathspecification
- the topic specificationoldValue
- the previous value. Will be null for the initial call to onValue for a topic. It can also be null if the topic's data type supports null values.newValue
- the new value derived from the last update received from the server. It can be null if the topic's data type supports null values.
-