DatasyncEvent

public struct DatasyncEvent : CustomStringConvertible, CustomDebugStringConvertible

A value representing an event of the DatasyncService.

When the the DatasyncEventType.child(addition:change:removal:acknowledgement:) type was specified for the subscription, each DatasyncEvent instance 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, several DatasyncEvent instances are sent.

Stored Properties

API

  • Indicates whether this value wrapped in this event is acknowledged by the back-end.

    When this property is false, the value is only local. It can be either acknowledged or rejected by the back-end later.

    Declaration

    Swift

    public var acked: Bool { get }
  • The atomic type of this event.

    This property is useful when an event callback is used for a composite event type.

    For example, if:

    then this value will be .child(addition: false, change: true, removal: false, acknowledgement: false) (please note the false value for the addition associated value this time), i.e. DatasyncEventType.childChange.

    Declaration

    Swift

    public var eventType: DatasyncEventType { get }
  • key

    The key of the node to which this event relates.

    The returned key depends on eventType value:

    Declaration

    Swift

    public var key: WebcomKey { get }
  • A reference to the node to which this event relates.

    The returned node reference depends on eventType value:

    When the manager of the node whose subscription has emitted this event no longer exists, this property is nil. This cannot happen when the subscription is stored by the manager, which corresponds to the default value of the stores parameter of the DatasyncNode.subscribe(to:childrenConstraint:stores:file:line:queue:onEvent:onCompletion:) method.

    Declaration

    Swift

    public var node: DatasyncNode? { get }

CustomStringConvertible Protocol

  • Declaration

    Swift

    public var description: String { get }

CustomDebugStringConvertible Protocol

  • Declaration

    Swift

    public var debugDescription: String { get }