Diffusion .NET API  5.9.24
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events Pages
PushTechnology.ClientInterface.Client.Features.ITopicStream Interface Reference

Represents a generic stream interface that can be registered to receive topic subscription, value and delta events. More...

Inheritance diagram for PushTechnology.ClientInterface.Client.Features.ITopicStream:
PushTechnology.ClientInterface.Client.Callbacks.IStream PushTechnology.ClientInterface.Client.Callbacks.ICallback PushTechnology.ClientInterface.Client.Features.TopicStreamDefault

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...
 

Detailed Description

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

Member Function Documentation

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.

Parameters
topicPathThe full topic path.
detailsThe 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.

Parameters
topicPathThe full topic path.
contentThe topic content. The context can contain more information about the nature of the content.
contextThe 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.

Parameters
topicPathThe full topic path.
reasonThe reason for unsubscription.

Implemented in PushTechnology.ClientInterface.Client.Features.TopicStreamDefault.


The documentation for this interface was generated from the following file: