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

Introduction

An update stream builder.

Builder for update stream to use for updating a specific topic.

The type of the topic being updated must match the update stream type.

To create a new Update Stream Builder, please use newUpdateStreamBuilder.

Since
6.9
Inheritance diagram for PTDiffusionUpdateStreamBuilder:

Instance Methods

(instancetype) - topicSpecification:
 
(instancetype) - updateConstraint:
 
(instancetype) - reset
 
(PTDiffusionStringUpdateStream *) - stringUpdateStreamWithPath:
 
(PTDiffusionNumberUpdateStream *) - doubleFloatNumberUpdateStreamWithPath:
 
(PTDiffusionNumberUpdateStream *) - int64NumberUpdateStreamWithPath:
 
(PTDiffusionBinaryUpdateStream *) - binaryUpdateStreamWithPath:
 
(PTDiffusionJSONUpdateStream *) - jsonUpdateStreamWithPath:
 
(PTDiffusionRecordV2UpdateStream *) - recordUpdateStreamWithPath:
 

Method Documentation

- (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.

Parameters
pathThe path of the topic.
Returns
An update stream.
Exceptions
NSInvalidArgumentExceptionIf any argument is nil.
Since
6.3
- (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.

Parameters
pathThe path of the topic.
Returns
An update stream.
Exceptions
NSInvalidArgumentExceptionIf any argument is nil.
Since
6.9
- (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.

Parameters
pathThe path of the topic.
Returns
An update stream.
Exceptions
NSInvalidArgumentExceptionIf any argument is nil.
Since
6.9
- (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.

Parameters
pathThe path of the topic.
Returns
An update stream.
Exceptions
NSInvalidArgumentExceptionIf path is nil.
Since
6.9
- (PTDiffusionRecordV2UpdateStream *) recordUpdateStreamWithPath: (NSString *)  path

Creates an update stream to use for updating a specific topic with RecordV2 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.

Parameters
pathThe path of the topic.
Returns
An update stream.
Exceptions
NSInvalidArgumentExceptionIf any argument is nil.
Since
6.9
- (instancetype) reset

Resets the builder to its default parameters.

Returns
the builder
Since
6.9
- (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.

Parameters
pathThe path of the topic.
Returns
An update stream.
Exceptions
NSInvalidArgumentExceptionIf any argument is nil.
Since
6.9
- (instancetype) topicSpecification: (PTDiffusionTopicSpecification *const _Nullable)  specification

Specifies a topic specification for this update stream.

If a topic does not exist at the path, one will be created using the topic specification, otherwise the operation will fail.

Specification is nil by default. Calling this method with a nil parameter removes the currently set topic specification from this builder.

Parameters
specificationthe required specification for the topic
Returns
the builder
Since
6.9
- (instancetype) updateConstraint: (PTDiffusionUpdateConstraint *const _Nullable)  constraint

Constraints can be applied to the setting of a value and creation of an update stream. Constraints describe a condition that must be satisfied for the operation to succeed. The constraints are evaluated on the server. The available constraints are:

  • active session lock
  • absence of a topic,
  • current value of the topic being updated
  • part of the current value of the topic being updated

Constraint is nil by default. Calling this method with a nil parameter removes the currently set update constraint from this builder.

Parameters
constraintthe constraint that must be satisfied for the update stream to be validated
Returns
the builder
Since
6.9