![]() |
Diffusion Apple API 6.11.5
Unified Client Library for iOS, tvOS and OS X / macOS
|
The Topic Update feature provides a client session with the ability to update topics.
Topics can be set to new values using stateless set operations or by using an update stream. Both mechanisms ensure that new values are applied safely to appropriate topics.
An update stream is created for a specific topic. An update stream builder can be obtained using the newUpdateStreamBuilder (PTDiffusionTopicUpdateFeature) method. The type of the topic must match the type of values passed to the update stream. An update stream can be used to send any number of updates. It sends a sequence of updates for a specific topic to the server. If supported by the data type, updates will be sent to the server as a stream of binary deltas.
Update streams have additional ways of failing compared to stateless set operations but when used repeatedly have lower overheads. This is because update streams maintain a small amount of state that reduces the overhead of operations but can become invalid for example, if the topic is deleted, or some other session updates the topic value.
By default, update streams use a form of optimistic locking. An update stream can update its topic incrementally as long as nothing else updates the topic. If the topic is updated independently (for example, by another session, or by the current session via set or a different update stream), then the next update performed by the update stream will complete with an 'invalid update stream' error.
Applications can choose to use collaborative locking to coordinate exclusive access to a topic. To follow this pattern acquire a PTDiffusionSessionLock and use it with a lockedWithLock: (PTDiffusionUpdateConstraint) constraint. The application is responsible for designing a locking scheme which determines which lock is required to access a particular topic, and for ensuring that all parts of the application that update the topic follow this scheme. Lock constraints and an application locking scheme can also ensure a sequence of set operations has exclusive access to the topic.
When a PTDiffusionTopicType_String, PTDiffusionTopicType_Int64 or PTDiffusionTopicType_Double topic is set to nil
, the topic will be updated to have no value. If a previous value was present subscribers will receive a notification that the new value is nil
. New subscribers will not receive a value notification.
When setting a value using either stateless operations or update streams it is possible to add a topic if one is not present. This is done using the 'and and set' methods or providing a topic specification when creating the update stream. If a topic exists these methods will update the existing topic.
Time series topics have a specific update protocol and are not supported by this feature. Use PTDiffusionTimeSeriesFeature to update time series topics.
To update a topic a session needs UPDATE_TOPIC
permission for the topic path. To create a topic a session needs MODIFY_TOPIC
permission for the topic path. Requests that combine adding a topic and setting the value, such as those sent by the 'add and set' methods, require both permissions.
The Topic Update feature for a session can be obtained from the session's topicUpdate
property.
This feature is also extended by PTDiffusionTopicsFeature. This means it is possible to use the methods described here through that feature.
Additional Inherited Members | |
![]() | |
PTDiffusionSession * | session |
- (void) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToBinaryValue: | (PTDiffusionBinary *) | value | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
Ensures a topic exists and sets it to a binary value.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toBinaryValue:completionHandler:.
path | The path of the topic. |
value | The value. |
specification | The required specification of 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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
NSInvalidArgumentException | If any argument is `nil` or if the topic type defined in the specification is incompatible with binary (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionBinary).
- (void) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToBinaryValue: | (PTDiffusionBinary *) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
Ensures a topic exists and sets it to a binary value if a constraint is satisfied.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setTopicWithPath:toBinaryValue:constraint:completionHandler:.
path | The path of the topic. |
specification | The required specification of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
NSInvalidArgumentException | If any argument is `nil` or if the topic type defined in the specification is incompatible with binary (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionBinary).
- (BOOL) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToDoubleFloatNumberValue: | (nullable NSNumber *) | value | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
error: | (NSError **) | error | |
Ensures a topic exists and sets it to a double-precision floating point (Eight-byte IEEE 754) number value, or null.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toJSONValue:completionHandler:.
path | The path of the topic. |
value | The value. |
specification | The required specification of 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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
error | If this method returns NO to indicate that an error occurred then this will be populated with the reason for that failure. |
YES
on success; or NO
if an error occurred, in which case *error
will be populated with the failure reason.NSInvalidArgumentException | If any of the path, specification or completionHandler arguments are nil . Also if the topic type defined in the specification is incompatible with doubleFloat (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (BOOL) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToDoubleFloatNumberValue: | (nullable NSNumber *) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
error: | (NSError **) | error | |
Ensures a topic exists and sets it to a double-precision floating point (Eight-byte IEEE 754) number value, or null, if a constraint is satisfied.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toJSONValue:constraint:completionHandler:.
path | The path of the topic. |
specification | The required specification of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
error | If this method returns NO to indicate that an error occurred then this will be populated with the reason for that failure. |
YES
on success; or NO
if an error occurred, in which case *error
will be populated with the failure reason.NSInvalidArgumentException | If any of the path, specification, constraint or completionHandler arguments are nil . Also if the topic type defined in the specification is incompatible with doubleFloat (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (void) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToDoubleValue: | (double) | value | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
Ensures a topic exists and sets it to a double-precision floating point (Eight-byte IEEE 754) value.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toJSONValue:completionHandler:.
path | The path of the topic. |
value | The value. |
specification | The required specification of 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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
NSInvalidArgumentException | If any of the path, specification or completionHandler arguments are nil . Also if the topic type defined in the specification is incompatible with doubleFloat (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (void) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToDoubleValue: | (double) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
Ensures a topic exists and sets it to a double-precision floating point (Eight-byte IEEE 754) value if a constraint is satisfied.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toJSONValue:constraint:completionHandler:.
path | The path of the topic. |
specification | The required specification of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
NSInvalidArgumentException | If any of the path, specification, constraint or completionHandler arguments are nil . Also if the topic type defined in the specification is incompatible with doubleFloat (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (BOOL) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToInt64NumberValue: | (nullable NSNumber *) | value | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
error: | (NSError **) | error | |
Ensures a topic exists and sets it to a 64-bit integer number value, or null.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toJSONValue:completionHandler:.
path | The path of the topic. |
value | The value. |
specification | The required specification of 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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
error | If this method returns NO to indicate that an error occurred then this will be populated with the reason for that failure. |
YES
on success; or NO
if an error occurred, in which case *error
will be populated with the failure reason.NSInvalidArgumentException | If any of the path, specification or completionHandler arguments are nil . Also if the topic type defined in the specification is incompatible with int64 (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (BOOL) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToInt64NumberValue: | (nullable NSNumber *) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
error: | (NSError **) | error | |
Ensures a topic exists and sets it to a 64-bit integer number value, or null, if a constraint is satisfied.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toJSONValue:constraint:completionHandler:.
path | The path of the topic. |
specification | The required specification of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
error | If this method returns NO to indicate that an error occurred then this will be populated with the reason for that failure. |
YES
on success; or NO
if an error occurred, in which case *error
will be populated with the failure reason.NSInvalidArgumentException | If any of the path, specification, constraint or completionHandler arguments are nil . Also if the topic type defined in the specification is incompatible with int64 (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (void) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToJSONValue: | (PTDiffusionJSON *) | value | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
Ensures a topic exists and sets it to a JSON value.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toJSONValue:completionHandler:.
path | The path of the topic. |
value | The value. |
specification | The required specification of 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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
NSInvalidArgumentException | If any argument is `nil` or if the topic type defined in the specification is incompatible with json (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionJSON).
- (void) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToJSONValue: | (PTDiffusionJSON *) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
Ensures a topic exists and sets it to a JSON value if a constraint is satisfied.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toJSONValue:constraint:completionHandler:.
path | The path of the topic. |
specification | The required specification of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
NSInvalidArgumentException | If any argument is `nil` or if the topic type defined in the specification is incompatible with json (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionJSON).
- (void) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToLongLongValue: | (long long) | value | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
Ensures a topic exists and sets it to a 64-bit integer value.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toJSONValue:completionHandler:.
path | The path of the topic. |
value | The value. |
specification | The required specification of 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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
NSInvalidArgumentException | If any of the path, specification or completionHandler arguments are nil . Also if the topic type defined in the specification is incompatible with int64 (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (void) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToLongLongValue: | (long long) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
Ensures a topic exists and sets it to a 64-bit integer value if a constraint is satisfied.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toJSONValue:constraint:completionHandler:.
path | The path of the topic. |
specification | The required specification of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
NSInvalidArgumentException | If any of the path, specification, constraint or completionHandler arguments are nil . Also if the topic type defined in the specification is incompatible with int64 (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (void) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToRecordValue: | (PTDiffusionRecordV2 *) | value | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
Ensures a topic exists and sets it to a record value.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toRecordValue:completionHandler:.
path | The path of the topic. |
value | The value. |
specification | The required specification of 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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
NSInvalidArgumentException | If any argument is `nil` or if the topic type defined in the specification is incompatible with recordV2 (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionRecordV2).
- (void) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToRecordValue: | (PTDiffusionRecordV2 *) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
Ensures a topic exists and sets it to a record value if a constraint is satisfied.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toRecordValue:constraint:completionHandler:.
path | The path of the topic. |
specification | The required specification of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
NSInvalidArgumentException | If any argument is `nil` or if the topic type defined in the specification is incompatible with recordV2 (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionRecordV2).
- (BOOL) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToStringValue: | (nullable NSString *) | value | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
error: | (NSError **) | error | |
Ensures a topic exists and sets it to a string value, or null.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toJSONValue:completionHandler:.
path | The path of the topic. |
value | The value. |
specification | The required specification of 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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
error | If this method returns NO to indicate that an error occurred then this will be populated with the reason for that failure. |
YES
on success; or NO
if an error occurred, in which case *error
will be populated with the failure reason.NSInvalidArgumentException | If any of the path, specification or completionHandler arguments are nil . Also if the topic type defined in the specification is incompatible with string (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (BOOL) addWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
andSetToStringValue: | (nullable NSString *) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error)) | completionHandler | |
error: | (NSError **) | error | |
Ensures a topic exists and sets it to a string value, or null, if a constraint is satisfied.
If a topic does not exist at the path, one will be created using the specification. If a topic does exist, its specification must match specification, otherwise the operation will fail.
In other respects this method works in the same way as setWithPath:toJSONValue:constraint:completionHandler:.
path | The path of the topic. |
specification | The required specification of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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 and result will be non-nil . The completion handler will be called asynchronously on the main dispatch queue. |
error | If this method returns NO to indicate that an error occurred then this will be populated with the reason for that failure. |
YES
on success; or NO
if an error occurred, in which case *error
will be populated with the failure reason.NSInvalidArgumentException | If any of the path, specification or completionHandler arguments are nil . Also if the topic type defined in the specification is incompatible with string (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (void) applyJsonPatch: | (NSString *) | jsonPatch | |
toPath: | (NSString *) | path | |
completionHandler: | (void(^)(PTDiffusionJSONPatchResult *result, NSError *_Nullable error)) | completionHandler | |
Applies a JSON Patch to a JSON topic.
The patch
argument should be formatted according to the JSON Patch standard (RFC 6902).
Patches are a sequence of JSON Patch operations contained in an array. They are applied as an atomic update to the previous value if the resulting update is successfully calculated. The following patch will check the value at a specific key and update if the expected value is correct:
[{"op":"test", "path":"/price", "value" : 22}, {"op":"add", "path":"/price", "value": 23}]
The available operations are:
{"op": "add", "path": "/a/b/c", "value": [ "foo", "bar" ]}
{"op": "remove", "path": "/a/b/c"}
{"op": "replace", "path": "/a/b/c", "value": 43}
{"op": "move", "from": "/a/b/c", "path": "/a/b/d"}
{"op": "copy", "from": "/a/b/c", "path": "/a/b/e"}
{"op": "test", "path": "/a/b/c", "value": "foo"}
The test operation checks that the CBOR representation of the value of a topic is identical to the value provided in the patch after converting it to CBOR. If the value is represented differently as CBOR, commonly due to different key ordering, then the patch will return the index of the failed operation . e.g the values {"foo": "bar", "count": 43}
and {"count": 43, "foo": "bar"}
are unequal despite semantic equality due to the differences in a byte for byte comparison.
jsonPatch | the JSON Patch |
path | the path of the topic to patch |
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. |
- (void) applyJsonPatch: | (NSString *) | jsonPatch | |
toPath: | (NSString *) | path | |
withConstraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(PTDiffusionJSONPatchResult *result, NSError *_Nullable error)) | completionHandler | |
Applies a JSON Patch to a JSON topic.
Takes a constraint that must be satisfied for the update to be applied.
In other respects this method works in the same way as applyJsonPatch:toPath:completionHandler:
jsonPatch | the JSON Patch |
path | the path of the topic to patch |
constraint | the constraint that must be satisfied for the patch to be applied |
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. |
- (PTDiffusionBinaryUpdateStream *) binaryUpdateStreamWithPath: | (NSString *) | path |
Creates an update stream to use for updating a specific topic with binary values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
NSInvalidArgumentException | If any argument is `nil`. |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionBinary).
- (PTDiffusionBinaryUpdateStream *) binaryUpdateStreamWithPath: | (NSString *) | path | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
Creates an update stream to use for updating a specific topic with binary values if a constraint is satisfied.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
constraint | The constraint that must be satisfied for the update stream to be validated. |
NSInvalidArgumentException | If any argument is `nil`. |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionBinary).
- (PTDiffusionBinaryUpdateStream *) binaryUpdateStreamWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
Creates an update stream to use for creating and updating a specific topic with binary values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
specification | The required specification of the topic. |
NSInvalidArgumentException | If any argument is `nil` or if the topic type defined in the specification is incompatible with binary (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionBinary).
- (PTDiffusionBinaryUpdateStream *) binaryUpdateStreamWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
Creates an update stream to use for creating and updating a specific topic with binary values if a constraint is satisfied.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
specification | The required specification of the topic. |
constraint | The constraint that must be satisfied for the update stream to be validated. |
NSInvalidArgumentException | If any argument is `nil` or if the topic type defined in the specification is incompatible with binary (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionBinary).
- (PTDiffusionNumberUpdateStream *) doubleFloatNumberUpdateStreamWithPath: | (NSString *) | path |
Creates an update stream to use for updating a specific topic with double-precision floating point (Eight-byte IEEE 754) values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
NSInvalidArgumentException | If any argument is `nil`. |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (PTDiffusionNumberUpdateStream *) doubleFloatNumberUpdateStreamWithPath: | (NSString *) | path | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
Creates an update stream to use for updating a specific topic with double-precision floating point (Eight-byte IEEE 754) values if a constraint is satisfied.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
constraint | The constraint that must be satisfied for the update stream to be validated. |
NSInvalidArgumentException | If any argument is `nil`. |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (PTDiffusionNumberUpdateStream *) doubleFloatNumberUpdateStreamWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
Creates an update stream to use for creating and updating a specific topic with double-precision floating point (Eight-byte IEEE 754) values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
specification | The required specification of the topic. |
NSInvalidArgumentException | If any argument is `nil` or the topic type defined in the specification is incompatible with doubleFloat (PTDiffusionDataTypes). |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (PTDiffusionNumberUpdateStream *) doubleFloatNumberUpdateStreamWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
Creates an update stream to use for creating and updating a specific topic with double-precision floating point (Eight-byte IEEE 754) values if a constraint is satisfied.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
specification | The required specification of the topic. |
constraint | The constraint that must be satisfied for the update stream to be validated. |
NSInvalidArgumentException | If any argument is `nil` or the topic type defined in the specification is incompatible with doubleFloat (PTDiffusionDataTypes). |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (PTDiffusionNumberUpdateStream *) int64NumberUpdateStreamWithPath: | (NSString *) | path |
Creates an update stream to use for updating a specific topic with 64-bit integer values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
NSInvalidArgumentException | If any argument is `nil`. |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (PTDiffusionNumberUpdateStream *) int64NumberUpdateStreamWithPath: | (NSString *) | path | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
Creates an update stream to use for updating a specific topic with 64-bit integer values if a constraint is satisfied.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
constraint | The constraint that must be satisfied for the update stream to be validated. |
NSInvalidArgumentException | If any argument is `nil`. |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (PTDiffusionNumberUpdateStream *) int64NumberUpdateStreamWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
Creates an update stream to use for creating and updating a specific topic with 64-bit integer values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
specification | The required specification of the topic. |
NSInvalidArgumentException | If any argument is `nil` or the topic type defined in the specification is incompatible with int64 (PTDiffusionDataTypes). |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (PTDiffusionNumberUpdateStream *) int64NumberUpdateStreamWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
Creates an update stream to use for creating and updating a specific topic with 64-bit integer values if a constraint is satisfied.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
specification | The required specification of the topic. |
constraint | The constraint that must be satisfied for the update stream to be validated. |
NSInvalidArgumentException | If any argument is `nil` or the topic type defined in the specification is incompatible with int64 (PTDiffusionDataTypes). |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (PTDiffusionJSONUpdateStream *) jsonUpdateStreamWithPath: | (NSString *) | path |
Creates an update stream to use for updating a specific topic with JSON values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
NSInvalidArgumentException | If path is `nil`. |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionJSON).
- (PTDiffusionJSONUpdateStream *) jsonUpdateStreamWithPath: | (NSString *) | path | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
Creates an update stream to use for updating a specific topic with JSON values if a constraint is satisfied.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
constraint | The constraint that must be satisfied for the update stream to be validated. |
NSInvalidArgumentException | If either argument is `nil`. |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionJSON).
- (PTDiffusionJSONUpdateStream *) jsonUpdateStreamWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
Creates an update stream to use for creating and updating a specific topic with JSON values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
specification | The required specification of the topic. |
NSInvalidArgumentException | If any argument is `nil` or if the topic type defined in the specification is incompatible with json (PTDiffusionDataTypes). |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionJSON).
- (PTDiffusionJSONUpdateStream *) jsonUpdateStreamWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
Creates an update stream to use for creating and updating a specific topic with JSON values if a constraint is satisfied.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
specification | The required specification of the topic. |
constraint | The constraint that must be satisfied for the update stream to be validated. |
NSInvalidArgumentException | If any argument is `nil` or if the topic type defined in the specification is incompatible with json (PTDiffusionDataTypes). |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionJSON).
- (PTDiffusionUpdateStreamBuilder *) newUpdateStreamBuilder |
Builder for update stream
to use for updating a specific topic.
The type of the topic being updated must match the type of the created update stream.
- (PTDiffusionRecordV2UpdateStream *) recordUpdateStreamWithPath: | (NSString *) | path |
Creates an update stream to use for updating a specific topic with record values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
NSInvalidArgumentException | If any argument is `nil`. |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionRecordV2).
- (PTDiffusionRecordV2UpdateStream *) recordUpdateStreamWithPath: | (NSString *) | path | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
Creates an update stream to use for updating a specific topic with record values if a constraint is satisfied.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
constraint | The constraint that must be satisfied for the update stream to be validated. |
NSInvalidArgumentException | If any argument is `nil`. |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionRecordV2).
- (PTDiffusionRecordV2UpdateStream *) recordUpdateStreamWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
Creates an update stream to use for creating and updating a specific topic with record values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
specification | The required specification of the topic. |
NSInvalidArgumentException | If any argument is `nil` or if the topic type defined in the specification is incompatible with recordV2 (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionRecordV2).
- (PTDiffusionRecordV2UpdateStream *) recordUpdateStreamWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
Creates an update stream to use for creating and updating a specific topic with record values if a constraint is satisfied.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
specification | The required specification of the topic. |
constraint | The constraint that must be satisfied for the update stream to be validated. |
NSInvalidArgumentException | If any argument is `nil` or if the topic type defined in the specification is incompatible with recordV2 (PTDiffusionDataTypes). |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionRecordV2).
- (void) setWithPath: | (NSString *) | path | |
toBinaryValue: | (PTDiffusionBinary *) | value | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
Sets a topic to a specified binary value.
path | The path of the topic. |
value | The value. |
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. |
NSInvalidArgumentException | If any argument is `nil`. |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionBinary).
- (void) setWithPath: | (NSString *) | path | |
toBinaryValue: | (PTDiffusionBinary *) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
Sets a topic to a specified binary value if a constraint is satisfied.
path | The path of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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. |
NSInvalidArgumentException | If any argument is `nil`. |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionBinary).
- (BOOL) setWithPath: | (NSString *) | path | |
toDoubleFloatNumberValue: | (nullable NSNumber *) | value | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
error: | (NSError **) | error | |
Sets a topic to a specified double-precision floating point (Eight-byte IEEE 754) number value, or null.
path | The path of the topic. |
value | The value. |
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. |
error | If this method returns NO to indicate that an error occurred then this will be populated with the reason for that failure. |
YES
on success; or NO
if an error occurred, in which case *error
will be populated with the failure reason.NSInvalidArgumentException | If either path or completionHandler are nil . |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (BOOL) setWithPath: | (NSString *) | path | |
toDoubleFloatNumberValue: | (nullable NSNumber *) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
error: | (NSError **) | error | |
Sets a topic to a specified double-precision floating point (Eight-byte IEEE 754) number value, or null, if a constraint is satisfied.
path | The path of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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. |
error | If this method returns NO to indicate that an error occurred then this will be populated with the reason for that failure. |
YES
on success; or NO
if an error occurred, in which case *error
will be populated with the failure reason.NSInvalidArgumentException | If any of path, constraint or completionHandler are nil . |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (void) setWithPath: | (NSString *) | path | |
toDoubleValue: | (double) | value | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
Sets a topic to a specified double-precision floating point (Eight-byte IEEE 754) value.
path | The path of the topic. |
value | The value. |
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. |
NSInvalidArgumentException | If either path or completionHandler are nil . |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (void) setWithPath: | (NSString *) | path | |
toDoubleValue: | (double) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
Sets a topic to a specified double-precision floating point (Eight-byte IEEE 754) value if a constraint is satisfied.
path | The path of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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. |
NSInvalidArgumentException | If any of path, constraint or completionHandler are nil . |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (BOOL) setWithPath: | (NSString *) | path | |
toInt64NumberValue: | (nullable NSNumber *) | value | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
error: | (NSError **) | error | |
Sets a topic to a specified 64-bit integer number value, or null.
path | The path of the topic. |
value | The value. |
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. |
error | If this method returns NO to indicate that an error occurred then this will be populated with the reason for that failure. |
YES
on success; or NO
if an error occurred, in which case *error
will be populated with the failure reason.NSInvalidArgumentException | If either path or completionHandler are nil . |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (BOOL) setWithPath: | (NSString *) | path | |
toInt64NumberValue: | (nullable NSNumber *) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
error: | (NSError **) | error | |
Sets a topic to a specified 64-bit integer number value, or null, if a constraint is satisfied.
path | The path of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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. |
error | If this method returns NO to indicate that an error occurred then this will be populated with the reason for that failure. |
YES
on success; or NO
if an error occurred, in which case *error
will be populated with the failure reason.NSInvalidArgumentException | If any of path, constraint or completionHandler are nil . |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (void) setWithPath: | (NSString *) | path | |
toJSONValue: | (PTDiffusionJSON *) | value | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
Sets a topic to a specified JSON value.
path | The path of the topic. |
value | The value. |
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. |
NSInvalidArgumentException | If any argument is `nil`. |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionJSON).
- (void) setWithPath: | (NSString *) | path | |
toJSONValue: | (PTDiffusionJSON *) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
Sets a topic to a specified JSON value if a constraint is satisfied.
path | The path of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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. |
NSInvalidArgumentException | If any argument is `nil`. |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionJSON).
- (void) setWithPath: | (NSString *) | path | |
toLongLongValue: | (long long) | value | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
Sets a topic to a specified 64-bit integer value.
path | The path of the topic. |
value | The value. |
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. |
NSInvalidArgumentException | If either path or completionHandler are nil . |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (void) setWithPath: | (NSString *) | path | |
toLongLongValue: | (long long) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
Sets a topic to a specified 64-bit integer value if a constraint is satisfied.
path | The path of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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. |
NSInvalidArgumentException | If any of path, constraint or completionHandler are nil . |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (void) setWithPath: | (NSString *) | path | |
toRecordValue: | (PTDiffusionRecordV2 *) | value | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
Sets a topic to a specified record value.
path | The path of the topic. |
value | The value. |
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. |
NSInvalidArgumentException | If any argument is `nil`. |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionRecordV2).
- (void) setWithPath: | (NSString *) | path | |
toRecordValue: | (PTDiffusionRecordV2 *) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
Sets a topic to a specified record value if a constraint is satisfied.
path | The path of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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. |
NSInvalidArgumentException | If any argument is `nil`. |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionRecordV2).
- (BOOL) setWithPath: | (NSString *) | path | |
toStringValue: | (nullable NSString *) | value | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
error: | (NSError **) | error | |
Sets a topic to a specified string value, or null.
path | The path of the topic. |
value | The value. |
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. |
error | If this method returns NO to indicate that an error occurred then this will be populated with the reason for that failure. |
YES
on success; or NO
if an error occurred, in which case *error
will be populated with the failure reason.NSInvalidArgumentException | If either path or completionHandler are nil . |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (BOOL) setWithPath: | (NSString *) | path | |
toStringValue: | (nullable NSString *) | value | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
error: | (NSError **) | error | |
Sets a topic to a specified string value, or null, if a constraint is satisfied.
path | The path of the topic. |
value | The value. |
constraint | The constraint that must be satisfied for the topic to be updated. |
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. |
error | If this method returns NO to indicate that an error occurred then this will be populated with the reason for that failure. |
YES
on success; or NO
if an error occurred, in which case *error
will be populated with the failure reason.NSInvalidArgumentException | If any of path, constraint or completionHandler are nil . |
Provided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (PTDiffusionStringUpdateStream *) stringUpdateStreamWithPath: | (NSString *) | path |
Creates an update stream to use for updating a specific topic with string values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
NSInvalidArgumentException | If any argument is `nil`. |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (PTDiffusionStringUpdateStream *) stringUpdateStreamWithPath: | (NSString *) | path | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
Creates an update stream to use for updating a specific topic with string values if a constraint is satisfied.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
constraint | The constraint that must be satisfied for the update stream to be validated. |
NSInvalidArgumentException | If any argument is `nil`. |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (PTDiffusionStringUpdateStream *) stringUpdateStreamWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
Creates an update stream to use for creating and updating a specific topic with string values.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
specification | The required specification of the topic. |
NSInvalidArgumentException | If any argument is `nil` or the topic type defined in the specification is incompatible with string (PTDiffusionDataTypes). |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).
- (PTDiffusionStringUpdateStream *) stringUpdateStreamWithPath: | (NSString *) | path | |
specification: | (PTDiffusionTopicSpecification *) | specification | |
constraint: | (PTDiffusionUpdateConstraint *) | constraint | |
Creates an update stream to use for creating and updating a specific topic with string values if a constraint is satisfied.
Update streams send a sequence of updates for a specific topic. The updates may be delivered to the server as binary deltas. They do not provide exclusive access to the topic. If exclusive access is required update streams should be used with session locks as constraints.
Streams are validated lazily when the first 'set' or 'validate' operation is completed. Once validated a stream can be invalidated, after which it rejects future updates.
path | The path of the topic. |
specification | The required specification of the topic. |
constraint | The constraint that must be satisfied for the update stream to be validated. |
NSInvalidArgumentException | If any argument is `nil` or the topic type defined in the specification is incompatible with string (PTDiffusionDataTypes). |
PTDiffusionTopicUpdateFeature#newUpdateStreamBuilder
insteadProvided by category PTDiffusionTopicUpdateFeature(PTDiffusionPrimitive).