OptionalsubscriptionLoop 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.
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
Event received from subscription
Notification message
Any subscription error
Error object
Standalone pull-point subscription (separate from Events.globalSubscription). data - emitted when an event notification is received error - emitted when a pull / renew error occurs
Example: Filtered pull-point with renew and clean shutdown: