Home Manual Reference Source Test
import SyncStream from 'atvise-scm/src/lib/db/SyncStream.js'
public class | source

SyncStream

A Stream that divides a file Stream into a push stream and a pull stream to synchronize between local files and atvise-server.

Static Method Summary

Static Public Methods
public static

from(fileStream: Stream): SyncStream

Returns a new SyncStream based on a file stream.

public static

newer(a: Date, b: Date): Number

Compares two dates and calculates which is newer.

Constructor Summary

Public Constructor
public

constructor(fileStream: Stream)

Creates a new SyncStream based on a file stream.

Member Summary

Public Members
public

client: node-opcua.OPCUAClient

public

merged: Stream

A stream created by combing pull and push stream.

public

pullStream: Stream

The pull stream

public

pushStream: Stream

The push stream

public

session: node-opcua.ClientSession

Method Summary

Public Methods
public

pull(fn: Function(stream: Stream)): SyncStream

Add transforms to the pull stream.

public

push(fn: Function(stream: Stream)): SyncStream

Add transforms to the push stream.

Static Public Methods

public static from(fileStream: Stream): SyncStream source

Returns a new SyncStream based on a file stream.

Params:

NameTypeAttributeDescription
fileStream Stream

The file stream to use.

Return:

SyncStream

The resulting SyncStream.

public static newer(a: Date, b: Date): Number source

Compares two dates and calculates which is newer.

Params:

NameTypeAttributeDescription
a Date

The first date to compare.

b Date

The second date to comapre.

Return:

Number

A positive number if a is newer than b, a negative number if b is newer than a. 0 if a equals b.

Public Constructors

public constructor(fileStream: Stream) source

Creates a new SyncStream based on a file stream.

Params:

NameTypeAttributeDescription
fileStream Stream

The file stream to use.

Public Members

public client: node-opcua.OPCUAClient source

public merged: Stream source

A stream created by combing pull and push stream.

public pullStream: Stream source

The pull stream

public pushStream: Stream source

The push stream

public session: node-opcua.ClientSession source

Public Methods

public pull(fn: Function(stream: Stream)): SyncStream source

Add transforms to the pull stream.

Params:

NameTypeAttributeDescription
fn Function(stream: Stream)

Apply transforms to the pull stream.

Return:

SyncStream

Itself, to be chainable.

public push(fn: Function(stream: Stream)): SyncStream source

Add transforms to the push stream.

Params:

NameTypeAttributeDescription
fn Function(stream: Stream)

Apply transforms to the push stream.

Return:

SyncStream

Itself, to be chainable.