Diffusion Apple API  6.5.13
Unified Client Library for iOS, tvOS and OS X / macOS
 All Classes Files Functions Variables Enumerations Enumerator Properties Pages
Properties | Instance Methods | List of all members
PTDiffusionSubscriptionRoutingRequest Class Reference

Introduction

A single request from a session to subscribe to a routing topic.

Each request received by a handler must either be routed or deferred.

Since
6.1
Inheritance diagram for PTDiffusionSubscriptionRoutingRequest:

Properties

PTDiffusionSessionIdsessionId
 
NSString * topicPath
 

Instance Methods

(void) - deferWithCompletionHandler:
 
(void) - routeToSourceTopicPath:withCompletionHandler:
 

Method Documentation

- (void) deferWithCompletionHandler: (NSError *_Nullable error)  completionHandler

Defer the handling of this subscription request.

When a request is deferred, the server will discard the request, and the requesting session will not receive a subscription notification.

An implementation can retain the requesting PTDiffusionSessionId and the routing topic's path so a routing subscription can be established at a later time using the PTDiffusionSubscriptionControlFeature.

Each instance of this class can be used once. If route or defer has already been called for this instance, calling this method will cause a warning to be logged by the server, but otherwise have no effect.

Parameters
completionHandlerBlock to be called asynchronously on success or failure. If the operation was successful, the error argument passed to the block will be nil. The completion handler will be called asynchronously on the main dispatch queue.
Exceptions
NSInvalidArgumentExceptionRaised if completionHandler is nil.
Since
6.1
- (void) routeToSourceTopicPath: (NSString *)  topicPath
withCompletionHandler: (NSError *_Nullable error)  completionHandler 

Resolve a subscription request by providing the path of a source topic to which the requesting session will be subscribed via the routing topic.

The requesting session will receive a subscription notification with the routing topic's path and the topic specification of the source topic. If the source topic is stateful, the requesting session will also be sent an update for the routing topic path with the current value of the source topic. The existence of the source topic is hidden from the requesting session. Updates to the source topic are forwarded to the session as if they came from the routing topic.

A session that does not have SELECT_TOPIC or READ_TOPIC permission for the source topic cannot subscribe directly, but can be subscribed indirectly using this method.

Parameters
topicPathThe topic path of the source topic to route to.
completionHandlerBlock to be called asynchronously on success or failure. If the operation was successful, the error argument passed to the block will be nil. The completion handler will be called asynchronously on the main dispatch queue.
Exceptions
NSInvalidArgumentExceptionRaised if any supplied arguments are nil.
Since
6.1

Property Documentation

- (PTDiffusionSessionId*) sessionId
readnonatomicassign

Identifies the session making the subscription request.

Since
6.1
- (NSString*) topicPath
readnonatomicassign

Identifies the subscribed routing topic.

Since
6.1