nomad

@lacrypta/nomad v0.0.0 / VMWorker

Interface: VMWorker

An instance of an environment-agnostic worker.

Methods

kill()

kill(): this

Stop the worker instance immediately.

Returns

this

this, for chaining.

Defined in

worker.ts:64


listen()

listen(messageCallback: MessageCallback, errorCallback: ErrorCallback): this

Set the given callbacks as handlers for message / error.

Parameters

messageCallback: MessageCallback

Callback to use for message handling.

errorCallback: ErrorCallback

Callback to use for message errors.

Returns

this

this, for chaining.

Defined in

worker.ts:73


shout()

shout(data: object): this

Send the given data to the VMWorker.

[!warning] The given data object MUST be serializable via JSON.serialize.

Parameters

data: object

object to send to the VMWorker.

Returns

this

this, for chaining.

Defined in

worker.ts:84