Interface ISubscriberStream
Represents the base subscriber stream interface.
Namespace: PushTechnology.ClientInterface.Client.Features.Topics
Assembly: Diffusion.Client.dll
Syntax
public interface ISubscriberStream : IStream, ICallback
Methods
OnSubscription(String, ITopicSpecification)
This notifies when a topic is subscribed to.
Declaration
void OnSubscription(string topicPath, ITopicSpecification specification)
Parameters
Type | Name | Description |
---|---|---|
String | topicPath | The full topic path. |
ITopicSpecification | specification | The topic specification. |
Remarks
This method is called when a session is subscribed to a topic that matches the stream registration. This method is also called when a stream is added, for all of the session's subscriptions to topics that match the stream registration.
For a given topic, OnSubscription(String, ITopicSpecification) will be the initial notification, and the first notification following an OnUnsubscription(String, ITopicSpecification, TopicUnsubscribeReason) notification if the session re-subscribes to the topic.
This method is also called for fallback streams that match the topic type when the session removes the last stream that selected a subscribed topic. The fallback stream will now receive updates for the topic, starting with an immediate notification of the currently cached value (if any).
Currently, topic properties are not available through this notification.
OnUnsubscription(String, ITopicSpecification, TopicUnsubscribeReason)
This notifies when a topic is unsubscribed.
Declaration
void OnUnsubscription(string topicPath, ITopicSpecification specification, TopicUnsubscribeReason reason)
Parameters
Type | Name | Description |
---|---|---|
String | topicPath | The full topic path. |
ITopicSpecification | specification | The topic specification. |
TopicUnsubscribeReason | reason | The reason for unsubscription. |
Remarks
This method is called if the session is unsubscribed from a topic that matches the stream registration. The stream will receive no more updates for the topic unless the session re-subscribes to the topic.
This method is also called for fallback streams that match the topic type if the session adds the first stream that selects a subscribed topic (through AddStream<TValue>(String, IValueStream<TValue>)). For these notifications, reason will be STREAM_CHANGE. The fallback stream will no longer receive updates for the topic.