Diffusion .NET API
5.9.24
|
Represents a generic stream interface that can be registered to receive topic subscription, value and delta events. More...
Public Member Functions | |
void | OnSubscription (string topicPath, ITopicDetails details) |
Notifies when a topic is subscribed to. More... | |
void | OnUnsubscription (string topicPath, TopicUnsubscribeReason reason) |
Notifies when a topic is unsubscribed. More... | |
void | OnTopicUpdate (string topicPath, IContent content, IUpdateContext context) |
Notifies when a topic is updated. More... | |
Public Member Functions inherited from PushTechnology.ClientInterface.Client.Callbacks.IStream | |
void | OnClose () |
Called to notify that a stream context was closed normally. More... | |
Public Member Functions inherited from PushTechnology.ClientInterface.Client.Callbacks.ICallback | |
void | OnError (ErrorReason errorReason) |
Notification of a contextual error related to this callback. This is analogous to an exception being raised. Situations in which More... | |
Represents a generic stream interface that can be registered to receive topic subscription, value and delta events.
When using this type of stream it is the responsibility of the application to interpret delta events and apply them to any locally held values. For some types the use of a IValueStream{TValue} is much simpler.
A stream implementation is registered using ITopics.AddTopicStream(string, ITopicStream).
Such a stream will receive events for all topics that match the selector with which it is registered.
If the stream is removed, OnClose will be called.
If the session is closed, OnError will be called with SESSION_CLOSED.
Since 5.1
void PushTechnology.ClientInterface.Client.Features.ITopicStream.OnSubscription | ( | string | topicPath, |
ITopicDetails | details | ||
) |
Notifies when a topic is subscribed to.
This is called when a session becomes subscribed to a topic that matches with the stream. This method is also called when a stream is added that matches a topic to which the session is already subscribed.
This will always be the first notification on the stream for any single topic.
This provides only BASIC details of the topic.
topicPath | The full topic path. |
details | The basic topic details. |
Implemented in PushTechnology.ClientInterface.Client.Features.TopicStreamDefault.
void PushTechnology.ClientInterface.Client.Features.ITopicStream.OnTopicUpdate | ( | string | topicPath, |
IContent | content, | ||
IUpdateContext | context | ||
) |
Notifies when a topic is updated.
This indicates an update to the state of a topic that is subscribed to. Both value and delta updates are notified via this method and the supplied context will indicate which.
If the stream is added when the session is already subscribed to one or more matching topics, for some topic types ( JSON and SINGLE_VALUE) this will be called after the subscription notification to provide the current known value. This is not the case for other topic types where the current value is not retained and in which case the first notification could be a delta. Therefore for such topics it is important to add streams before subscription.
topicPath | The full topic path. |
content | The topic content. The context can contain more information about the nature of the content. |
context | The update context which can indicate whether the content represents the total state or a change to the state. |
Implemented in PushTechnology.ClientInterface.Client.Features.TopicStreamDefault.
void PushTechnology.ClientInterface.Client.Features.ITopicStream.OnUnsubscription | ( | string | topicPath, |
TopicUnsubscribeReason | reason | ||
) |
Notifies when a topic is unsubscribed.
topicPath | The full topic path. |
reason | The reason for unsubscription. |
Implemented in PushTechnology.ClientInterface.Client.Features.TopicStreamDefault.