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 |
context: RemoteContext: * Get the library remote context. |
Method Summary
Public Methods | ||
public |
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(value: RemoteValueProxy): boolean 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:
Name | Type | Attribute | Description |
stream | Duplex | A duplex stream to the local library |
|
opts | object |
|
Options to Context and RemoteSession |
Public Members
Public Methods
public delete(reference: Reference): boolean source
Delete a reference from RemoteContext.
Params:
Name | Type | Attribute | Description |
reference | Reference |
public get(reference: Reference): RemotePromise source
Fetch a reference value from RemoteContext.
Params:
Name | Type | Attribute | Description |
reference | Reference |
public on(eventName: string, listener: function): RemoteLibrary source
Bind a listener to the RemoteContext.
See:
public once(eventName: string, listener: function): RemoteLibrary source
Bind a listener once to the RemoteContext.
public release(value: RemoteValueProxy): boolean source
Release a value from RemoteContext.
Params:
Name | Type | Attribute | Description |
value | RemoteValueProxy |
public removeListener(eventName: string, listener: function): RemoteLibrary source
Remove a listener from the RemoteContext.
public resolve(value: *): RemotePromise source
Resolve a value with RemoteContext.
Params:
Name | Type | Attribute | Description |
value | * |