![]() |
Diffusion Apple API 6.12.0
Unified Client Library for iOS, tvOS and OS X / macOS
|
An update stream that provides the ability for updating topics with JSON values. More...
#include <PTDiffusionJSONUpdateStream.h>
Instance Methods | |
| (BOOL) | - setValue:completionHandler:error: |
| Instance Methods inherited from PTDiffusionUpdateStream | |
| (BOOL) | - validateWithCompletionHandler:error: |
| (BOOL) | - setValue:completionHandler:error: |
Properties | |
| PTDiffusionJSON * | value |
| Properties inherited from PTDiffusionUpdateStream | |
| ObjectType | value |
Additional Inherited Members | |
| Public Types inherited from PTDiffusionUpdateStream | |
| typedef void(^ | PTDiffusionUpdateStreamHandlerBlock) (PTDiffusionTopicCreationResult *_Nullable result, NSError *_Nullable error) |
| Protected Attributes inherited from PTDiffusionUpdateStream | |
| : NSObject+(instancetype)new | |
An update stream that provides the ability for updating topics with JSON values.
| - (BOOL) setValue: | (PTDiffusionJSON *) | value | |
| completionHandler: | (PTDiffusionUpdateStreamHandlerBlock) | completionHandler | |
| error: | (NSError **) | error |
Sets the topic to a specified value.
The first call to this method may fail with a "no such topic" or "incompatible topic" error. Subsequent calls may fail with "invalid update stream". Any call can fail with a "cluster repartition", "session security" or "session closed" error.
If a PTDiffusionUpdateConstraint was provided when creating the update stream, the first call to this method may also fail with an "unsatisified constraint" error.
If the update stream was created with one of the "create update stream" methods, the first call to this method may also fail with an "incompatible existing topic" error and it will not fail with a "no such topic" error.
If this method fails all subsequent calls to 'set' or 'validate' will fail with an "invalid update stream" error.
If the task fails, the completionHandler will be called with an error. Common reasons for failure include:
| value | The value to set the topic to. |
| 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. |
| NSInvalidArgumentException | If either value or completionHandler is nil. |
|
readnonatomicassign |
The latest value of the topic set using this update stream, from local cache.
This value reflects the last value that has been set, before it is sent to the server.
If the server rejects a set operation, the topic value will not change and this update stream will be invalidated.