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


A string value updater may be used to update string topics by specifying new values.

See Also
Inheritance diagram for PTDiffusionStringValueUpdater:

Instance Methods

(BOOL) - getCachedValue:forTopicPath:error:
(void) - updateWithTopicPath:value:completionHandler:
- Instance Methods inherited from PTDiffusionValueUpdater
(instancetype) - NS_UNAVAILABLE
(void) - removeCachedValuesWithTopicSelector:
(void) - removeCachedValuesWithSelectorExpression:

Additional Inherited Members

- Class Methods inherited from PTDiffusionValueUpdater
(instancetype) + NS_UNAVAILABLE

Method Documentation

- (BOOL) getCachedValue: (NSString *_Nullable *_Nonnull)  value
forTopicPath: (NSString *)  topicPath
error: (NSError **)  error 

Returns the current cached value for a given topic path.

valueOn successful return then set to the current cached value or nil if there is no value for the given path. There may be no value because no value has yet been sent, the value has been removed from the cache or the value has been explicitly set to nil by a preceding update.
topicPathSpecifies the topic to obtain the current value for.
errorIf an error occurs, upon return contains an NSError object that describes the problem.
YES if there is no cached value for the given topic path or if the cached entry for the given topic path is of the correct type. In either of these cases the value will be assigned appropriately. Otherwise this method returns NO and error will be assigned with a failure reason.
NSInvalidArgumentExceptionIf either of the value or topicPath arguments are nil.
- (void) updateWithTopicPath: (NSString *)  topicPath
value: (nullable NSString *)  value
completionHandler: (NSError *_Nullable error)  completionHandler 

Updates a topic to a specified value.

For exclusive updating, this method caches the supplied value so that subsequent calls for the same topic will be able to use the current value to calculate deltas of change to send to the server rather than having to send the whole value.

For non-exclusive updating, the complete value is always sent to the server and the value is not cached.

topicPathSpecifies the topic to be updated.
valueThe new value for the topic or nil to set to 'no value' (null).
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.
NSInvalidArgumentExceptionIf either of the topicPath or completionHandler arguments are nil.