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

ReadStream

Extends:

StreamQueueStream → ReadStream

A stream that reads atvise server nodes for the node-opcua~ReferenceDescriptions passed.

Test:

Method Summary

Public Methods
public

processChunk(browseResult: NodeStream.BrowseResult, handleErrors: function(err: Error, status: node-opcua~StatusCodes, success: function))

public

Returns an error message specifically for the given reference description.

Inherited Summary

From class Stream
private

true if the stream's atvise server session should be kept alive once the stream ends.

private

_flush(callback: function(err: ?Error, data: Object))

Called just before the stream is closed: Closes the open session.

From class QueueStream
public get

true if there are queued operations or an operation is running right now.

public get

The number of processed chunks per second.

public get

The number of chunks already processed.

public get

true if there are no queued operations.

private

The maximum of parallel tasks to execute

private

The number of chunks processed so far.

private

The number of running operations.

private

_queued: *[]

The queued chunks.

private

The timestamp of the date when the stream was created.

public abstract

processChunk(chunk: *, handleErrors: function(err: Error, statusCode: node-opcua~StatusCodes, onSuccess: function))

The function to call when a chunk is ready to be processed.

public abstract

The error message to use when processing a chunk fails.

private

_enqueueChunk(chunk: *)

Enqueues the given chunk for processing.

private

_flush(callback: Function)

Waits for pending operations to complete.

private

_processChunk(chunk: *)

Calls QueueStream#processChunk and handles errors and invalid status codes.

private

_transform(chunk: *, enc: string, callback: Function)

Calls QueueStream#_enqueueChunk as soon as the stream's session is opened.

Public Methods

public processChunk(browseResult: NodeStream.BrowseResult, handleErrors: function(err: Error, status: node-opcua~StatusCodes, success: function)) source

Returns a ReadStream.ReadResult for the given NodeStream.BrowseResult.

Override:

QueueStream#processChunk

Params:

NameTypeAttributeDescription
browseResult NodeStream.BrowseResult

The browse result to process:

  • If NodeStream.BrowseResult#nodeClass equals node-opcua~NodeClass.Variable the browse result is passed as-is to piped streams.
  • Otherwise the node's value is read from atvise server.
handleErrors function(err: Error, status: node-opcua~StatusCodes, success: function)

The error handler to call. See QueueStream#processChunk for details.

Test:

public processErrorMessage(referenceDescription: node-opcua~ReferenceDescription): string source

Returns an error message specifically for the given reference description.

Override:

QueueStream#processErrorMessage

Params:

NameTypeAttributeDescription
referenceDescription node-opcua~ReferenceDescription

The reference description to get the error message for.

Return:

string

The specific error message.

Test: