subscribe

fun subscribe(type: Child, constraint: Constraint = Constraint.None, includesAcknowledgements: Boolean = false, callback: WebcomResultCallback<ChildEvent>): Subscription

Subscribes to a Child event with a given constraint on this data node and sends notifications to a callback function.

If includesAcknowledgements is true, the callback function is additionnally notified when the data node is acknowledged by the back end (without other value change).

If the callback function receives a WebcomResult.Failure, this means the subscription has been revoked by the Webcom backend, therefore the function will no longer be called.

fun subscribe(type: ValueChanged.WithData, constraint: Constraint = Constraint.None, includesAcknowledgements: Boolean = false, callback: WebcomResultCallback<ValueChangedWithDataEvent>): Subscription

Subscribes to a ValueChanged.WithData event with a given constraint on this data node and sends notifications to a callback function.

If includesAcknowledgements is true, the callback function is additionnally notified when the data node is acknowledged by the back end (without other value change).

If the callback function receives a WebcomResult.Failure, this means the subscription has been revoked by the Webcom backend, therefore the function will no longer be called.

fun subscribe(type: ValueChanged.WithoutData, constraint: Constraint = Constraint.None, includesAcknowledgements: Boolean = false, callback: WebcomResultCallback<ValueChangedWithoutDataEvent>): Subscription

Subscribes to a ValueChanged.WithoutData event with a given constraint on this data node and sends notifications to a callback function.

If includesAcknowledgements is true, the callback function is additionnally notified when the data node is acknowledged by the back end (without other value change).

If the callback function receives a WebcomResult.Failure, this means the subscription has been revoked by the Webcom backend, therefore the function will no longer be called.