Home Reference Source
import RemoteLibrary from 'remote-lib/lib/RemoteLibrary.js'
public class | source

RemoteLibrary

A remote library connected with duplex stream to a local Library.

Example:

import { RemoteLibrary } from 'remote-lib';

const remoteLibrary = new RemoteLibrary(stream);

Constructor Summary

Public Constructor
public

constructor(stream: Duplex, opts: object): RemoteLibrary

Create a remote library with a duplex stream to a local Library.

Member Summary

Public Members
public get

Get the library remote context.

Method Summary

Public Methods
public

delete(reference: Reference): boolean

Delete a reference from RemoteContext.

public

destroy(): void

Destroy RemoteContext.

public

get(reference: Reference): RemotePromise

Fetch a reference value from RemoteContext.

public

on(eventName: string, listener: function): RemoteLibrary

Bind a listener to the RemoteContext.

public

once(eventName: string, listener: function): RemoteLibrary

Bind a listener once to the RemoteContext.

public

Release a value from RemoteContext.

public

removeListener(eventName: string, listener: function): RemoteLibrary

Remove a listener from the RemoteContext.

public

resolve(value: *): RemotePromise

Resolve a value with RemoteContext.

Public Constructors

public constructor(stream: Duplex, opts: object): RemoteLibrary source

Create a remote library with a duplex stream to a local Library.

Params:

NameTypeAttributeDescription
stream Duplex

A duplex stream to the local library

opts object
  • optional

Options to Context and RemoteSession

Return:

RemoteLibrary

Public Members

public get context: RemoteContext: * source

Get the library remote context.

Return:

RemoteContext

Public Methods

public delete(reference: Reference): boolean source

Delete a reference from RemoteContext.

Params:

NameTypeAttributeDescription
reference Reference

Return:

boolean

See:

public destroy(): void source

Destroy RemoteContext.

Return:

void

See:

public get(reference: Reference): RemotePromise source

Fetch a reference value from RemoteContext.

Params:

NameTypeAttributeDescription
reference Reference

Return:

RemotePromise

See:

public on(eventName: string, listener: function): RemoteLibrary source

Bind a listener to the RemoteContext.

Params:

NameTypeAttributeDescription
eventName string
listener function

Return:

RemoteLibrary

See:

public once(eventName: string, listener: function): RemoteLibrary source

Bind a listener once to the RemoteContext.

Params:

NameTypeAttributeDescription
eventName string
listener function

Return:

RemoteLibrary

See:

public release(value: RemoteValueProxy): boolean source

Release a value from RemoteContext.

Params:

NameTypeAttributeDescription
value RemoteValueProxy

Return:

boolean

See:

public removeListener(eventName: string, listener: function): RemoteLibrary source

Remove a listener from the RemoteContext.

Params:

NameTypeAttributeDescription
eventName string
listener function

Return:

RemoteLibrary

See:

public resolve(value: *): RemotePromise source

Resolve a value with RemoteContext.

Params:

NameTypeAttributeDescription
value *

Return:

RemotePromise

See: