Home Manual Reference Source Test
import Watcher from 'atscm/src/lib/server/Watcher.js'
public class | source

Watcher

Extends:

events~Emitter → Watcher

Watches the given nodes for value changes.

Constructor Summary

Public Constructor
public

constructor(nodes: NodeId[])

Creates a new Watcher with the given nodes.

Member Summary

Public Members
public

Resolved once the server subscription is set up.

Private Members
private

The browser used to subscribe to server nodes.

private

The current session, if connected @type {Session}

Method Summary

Public Methods
public

close()

Ends monitoring nodes.

Private Methods
private

Called once a change has been detected and emits a 'change' or 'delete' event.

private

Initializes a server subscription.

private

async _subscribe(node: BrowsedNode): *

Subscribes to value changes of a single node.

Public Constructors

public constructor(nodes: NodeId[]) source

Creates a new Watcher with the given nodes.

Params:

NameTypeAttributeDescription
nodes NodeId[]

The nodes to watch (recursively).

Test:

Public Members

public subscriptionStarted: Promise<any> source

Resolved once the server subscription is set up.

Private Members

private _nodeBrowser: NodeBrowser source

The browser used to subscribe to server nodes.

private _session: * source

The current session, if connected @type {Session}

Public Methods

public close() source

Ends monitoring nodes.

Test:

Private Methods

private _handleChange(node: Object, dataValue: node-opcua~Variant) source

Called once a change has been detected and emits a 'change' or 'delete' event.

Params:

NameTypeAttributeDescription
node Object

The node that changed.

dataValue node-opcua~Variant
  • nullable: true

The current value.

private _setupSubscription(): Promise<node-opcua~ClientSubscription> source

Initializes a server subscription.

Return:

Promise<node-opcua~ClientSubscription>

A setup subscription.

private async _subscribe(node: BrowsedNode): * source

Subscribes to value changes of a single node.

Params:

NameTypeAttributeDescription
node BrowsedNode

A browsed node.

Return:

*