DatasyncEventType
public enum DatasyncEventType : Equatable, CustomStringConvertible
A value representing the type of an event for a node.
This type is used to indicate:
- the type of events to subscribe to using the
DatasyncNode.subscribe(to:childrenConstraint:stores:file:line:queue:onEvent:onCompletion:)method, - the type of a received event by the
DatasyncEvent.eventTypeproperty.
-
The event relates to the value of the whole node.
The
changeassociated value relates to change of the value of the node:- for a subscription, it indicates whether to receive events when the value of the node changes,
- for a received event, it indicates that the value of the node has changed.
The
withoutDatawhether or not the associated notification should carry changed data with itThe
acknowledgementassociated value relates to acknowledgement of the local value of the node by the back-end:- for a subscription, it indicates whether to receive events when the back-end acknowledges the local value of the node,
- for a received event, it indicates that the back-end has acknowledged the local value of the node.
For a subscription, both associated values may be set to
truesimultaneously. In a received event, one and only one of the associated values istrue.Declaration
Swift
case value(change: Bool = false, withoutData: Bool = false, acknowledgement: Bool = false) -
The event relates to children of the node.
The
additionassociated value relates to children addition:- for a subscription, it indicates whether to receive events when new children are added to the node,
- for a received event, it indicates that one child has been added to the node.
The
changeassociated value relates to children change:- for a subscription, it indicates whether to receive events when the value of existing children changes,
- for a received event, it indicates that the value of one child has changed.
The
removalassociated value relates to children removal:- for a subscription, it indicates whether to receive events when children are removed from the node,
- for a received event, it indicates that one child has been removed from the node.
The
acknowledgementassociated value relates to acknowledgement of the local value of children of the node by the back-end:- for a subscription, it indicates whether to receive events when the back-end acknowledges the local value of children of the node,
- for a received event, it indicates that the back-end has acknowledged the local value of a child of the node.
For a subscription, several associated values may be set to
truesimultaneously. In a received event, one and only one of the associated values istrue.A
DatasyncEventinstance corresponds to exactly one addition or one change or one removal or one acknowledgement. When there are several additions and/or changes and/or removals and/or acknowledgements for the same node, severalDatasyncEventare sent.Declaration
Swift
case child(addition: Bool = false, change: Bool = false, removal: Bool = false, acknowledgement: Bool = false)
-
The event relates to a change of the value of the node.
This is a shortcut for
.value(change: true, acknowledgement: false).Declaration
Swift
public static let valueChange: DatasyncEventType -
The event relates to a change of the value of the node.
This is a shortcut for
.value(change: true, withoutData: true, acknowledgement: false).Declaration
Swift
public static let valueChangeWithoutData: DatasyncEventType -
The event relates to an acknowledgement of the local value of the node by the back-end.
This is a shortcut for
.value(change: false, acknowledgement: true).Declaration
Swift
public static let valueAcknowledgement: DatasyncEventType -
The event relates to the value of the whole node.
This is a shortcut for
.value(change: true, acknowledgement: true).Declaration
Swift
public static let valueEvent: DatasyncEventType -
The event relates to children addition.
This is a shortcut for
.child(addition: true, change: false, removal: false, acknowledgement: false).When a
DatasyncChildrenConstraintwas used for a subscription, a child entering the visibility window is seen as being added.Declaration
Swift
public static let childAddition: DatasyncEventType -
The event relates to children change.
This is a shortcut for
.child(addition: false, change: true, removal: false, acknowledgement: false).Declaration
Swift
public static let childChange: DatasyncEventType -
The event relates to children removal.
This is a shortcut for
.child(addition: false, change: false, removal: true, acknowledgement: false).When a
DatasyncChildrenConstraintwas used for a subscription, a child leaving in the visibility window is seen as being removed.Declaration
Swift
public static let childRemoval: DatasyncEventType -
The event relates to children addition or children change or children removal.
This is a shortcut for
.child(addition: true, change: true, removal: true, acknowledgement: false).Declaration
Swift
public static let childUpdate: DatasyncEventType -
The event relates to an acknowledgement of the local value of children of the node by the back-end.
This is a shortcut for
.child(addition: false, change: false, removal: false, acknowledgement: true).Declaration
Swift
public static let childAcknowledgement: DatasyncEventType -
The event relates to children of the node.
This is a shortcut for
.child(addition: true, change: true, removal: true, acknowledgement: true).Declaration
Swift
public static let childEvent: DatasyncEventType
-
Indicates whether the event relates to acknowledgement of the local value of the node or a child of the node by the back-end.
This property is
trueif and only if theacknowledgementassociated value istrue, either for the.value(change:acknowledgement)case or the.child(addition:change:removal:acknowledgement:)case.Declaration
Swift
public var isAcknowledgement: Bool { get }
-
Declaration
Swift
public var description: String { get }