PNDataSyncEventResult

data class PNDataSyncEventResult(result: BasePubSubResult, val extractedMessage: PNDataSyncEventMessage) : PubSubResult

A DataSync realtime change event delivered over PubNub subscribe.

DataSync ships realtime create/update/delete events for its elements (User, Channel, Entity, Relationship, Membership), analogous to how AppContext Objects (e=2) events are delivered. An event arrives on the ref-channel of the element it concerns (or, for a non-default projection, on the __{projection}__{ref} channel).

A single subscribed ref-channel receives a mix of PNDataSyncEventMessage leaf types, not just the element you named the handle after — for example subscribing to a user's ref also delivers the membership/relationship events where that user is an endpoint, and propagated events for entities joined to it. Branch on the sealed extractedMessage (or on PNDataSyncEventMessage.type) rather than assuming a single type.

Constructors

Link copied to clipboard
constructor(result: BasePubSubResult, extractedMessage: PNDataSyncEventMessage)

Properties

Link copied to clipboard
open override val channel: String
Link copied to clipboard

the typed, deserialized change event.

Link copied to clipboard
open override val publisher: String?
Link copied to clipboard
open override val subscription: String?
Link copied to clipboard
open override val timetoken: Long?
Link copied to clipboard
open override val userMetadata: JsonElement?