Loop events from the subscription
Pull messages from the subscription (long-poll).
Optionaloptions: Partial<PullMessages> & { signal?: AbortSignal }
ONVIF PullMessages fields, plus optional signal to cancel the HTTP request
before the device Timeout elapses (see innerDocs/events.md).
const ac = new AbortController();
const timer = setTimeout(() => ac.abort(), 5000);
try {
const { notificationMessage } = await sub.pullMessages({
timeout: 'PT1M',
signal: ac.signal,
});
} catch (err) {
if (!(err instanceof Error) || err.name !== 'AbortError') throw err;
// cancelled
} finally {
clearTimeout(timer);
}
Renew the subscription
Properties inform a client about property creation, changes and deletion in a uniform way. When a client wants to synchronize its properties with the properties of the device, it can request a synchronization point which repeats the current status of all properties to which a client has subscribed. The PropertyOperation of all produced notifications is set to “Initialized”. The Synchronization Point is requested directly from the SubscriptionManager which was returned in either the SubscriptionResponse or in the CreatePullPointSubscriptionResponse. The property update is transmitted via the notification transportation of the notification interface. This method is mandatory.
Create a pull-point subscription and start the background eventPull loop.
Overlapping subscribe/unsubscribe is coordinated with lifecycleGen: a Create that loses the race Unsubscribes its own pull-point by reference (without touching a newer winner's subscription). Unsubscribe stays non-blocking w.r.t. in-flight Create.
The device shall provide the following Unsubscribe command for all SubscriptionManager endpoints returned by the CreatePullPointSubscription command. This command shall terminate the lifetime of a pull point.
if we want to abort long-pulling connections, default true
Soft network / renew issue; same subscription is retried
Event received from subscription
Notification message
Pull/renew failure (resubscribe) or synchronous throw from a data listener (no resubscribe)
Error object (may be OnvifError / SOAP fault / network Error)
Standalone pull-point subscription (separate from Events.globalSubscription). data - emitted when an event notification is received error - pull / renew failure (triggers resubscribe), or a synchronous throw from a
datalistener (does not rebuild the pull point)Example: Filtered pull-point with renew and clean shutdown: