A record value updater may be used to update record topics by specifying new values.
- See Also
- PTDiffusionTopicUpdateControlFeature
-
PTDiffusionTopicUpdater
- Since
- 6.0
|
(instancetype) | + NS_UNAVAILABLE |
|
- (BOOL) getCachedValue: |
|
(PTDiffusionRecordV2 *_Nullable *_Nonnull) |
value |
forTopicPath: |
|
(NSString *) |
topicPath |
error: |
|
(NSError **) |
error |
|
|
| |
Returns the current cached value for a given topic path.
- Parameters
-
value | On 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, or the value has been removed from the cache. |
topicPath | Specifies the topic to obtain the current value for. |
error | If an error occurs, upon return contains an NSError object that describes the problem. |
- Returns
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.
- Exceptions
-
NSInvalidArgumentException | If either of the value or topicPath arguments are nil . |
- Since
- 6.0
- (void) updateWithTopicPath: |
|
(NSString *) |
topicPath |
value: |
|
(PTDiffusionRecordV2 *) |
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.
- Parameters
-
topicPath | Specifies the topic to be updated. |
value | The new value for the topic. |
completionHandler | Block 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
-
NSInvalidArgumentException | If any of the supplied arguments are nil . |
- Since
- 6.0