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.
const n = notify(…);
n.completed();
n.abort();- Source
- See
- notify()
- subscriber()
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.
const n = obj.notify("method", { data: "value" });
if (!n.completed()) {
n.abort();
}- Source
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.
const n = obj.notify("method", { data: "value" });
if (n.completed()) {
printf("Notification sent\n");
}- Source