ubus. notify

Represents an asynchronous notification request.

A notify object is created when sending a notification to subscribers via notify(). It allows tracking the delivery status of the notification and provides the ability to abort if needed.

Notifications are delivered to all subscribers of an object in the subscribe/notify communication scheme. The notify object provides non-blocking status checking and cancellation capabilities.

Example
const n = notify(…);

n.completed();
n.abort();
See

Methods

abort() → {boolean}

Abort a pending notification request.

Cancels an asynchronous notification request that has not yet completed.

Returns true if the request was aborted.

Returns false if the request was already completed.

Returns: boolean
Example
const n = obj.notify("method", { data: "value" });
if (!n.completed()) {
    n.abort();
}

completed() → {boolean}

Check if a notification request has completed.

Returns true if the notification request has finished.

Returns false if the request is still pending.

Returns: boolean
Example
const n = obj.notify("method", { data: "value" });
if (n.completed()) {
    printf("Notification sent\n");
}