Skip to content

Class: Subscription ​

Defined in: netconf/src/operations/notifications.ts:182

A subscription's notifications, in arrival order. Read it once, with for await or next(). Iteration ends when the subscription completes (stopTime), when the session closes, or when you dispose it, and fails with SubscriptionOverflowError if more than queueSize notifications wait unread.

Implements ​

Properties ​

ended ​

ts
readonly ended: Promise<{
  reason: NotificationSubscriptionEndReason;
}>;

Defined in: netconf/src/operations/notifications.ts:192

Resolves when the subscription ends, with the reason. Never rejects.


interleave ​

ts
readonly interleave: boolean;

Defined in: netconf/src/operations/notifications.ts:188

True if the server allows other operations on this session meanwhile.


replay ​

ts
readonly replay: boolean;

Defined in: netconf/src/operations/notifications.ts:186

True if startTime was given, so logged notifications are replayed first.


replayComplete ​

ts
readonly replayComplete: Promise<boolean>;

Defined in: netconf/src/operations/notifications.ts:190

Resolves true when the server reports replay complete, false if there was no replay or it ended first.


stream ​

ts
readonly stream: string | undefined;

Defined in: netconf/src/operations/notifications.ts:184

The stream requested, or undefined for the server default (NETCONF).

Methods ​

[asyncDispose]() ​

ts
[asyncDispose](): Promise<void>;

Defined in: netconf/src/operations/notifications.ts:273

Stop reading, as Subscription.return does; called by await using.

Returns ​

Promise<void>

Implementation of ​

AsyncDisposable.[asyncDispose]


[asyncIterator]() ​

ts
[asyncIterator](): this;

Defined in: netconf/src/operations/notifications.ts:278

The subscription itself, so it can be read with for await.

Returns ​

this

Implementation of ​

AsyncIterableIterator.[asyncIterator]


next() ​

ts
next(): Promise<IteratorResult<Notification, any>>;

Defined in: netconf/src/operations/notifications.ts:249

The next notification, waiting for one if none is queued; done once the subscription has ended, after rejecting once with a SubscriptionOverflowError if it ended because the queue overflowed.

Returns ​

Promise<IteratorResult<Notification, any>>

Implementation of ​

AsyncIterableIterator.next


return() ​

ts
return(): Promise<IteratorResult<Notification, any>>;

Defined in: netconf/src/operations/notifications.ts:265

Stop reading: the queue is emptied and iteration ends. RFC 5277 can't cancel a subscription, so the server keeps it until stopTime or the end of the session.

Returns ​

Promise<IteratorResult<Notification, any>>

Implementation of ​

AsyncIterableIterator.return

Released under the MIT Licence.