Class: AsyncProxy

worker/async_proxy~AsyncProxy(path, n, config, worker)

new AsyncProxy(path, n, config, worker)

Initializes a new proxy and loads the web worker

Parameters:
Name Type Description
path String

The path to the worker or 'openpgp.worker.js' by default

n Number

number of workers to initialize if path given

config Object

config The worker configuration

worker Array.<Object>

alternative to path parameter: web worker initialized with 'openpgp.worker.js'

Source:

Methods

(async) delegate(method, options) → {Promise}

Generic proxy function that handles all commands from the public api.

Parameters:
Name Type Description
method String

the public api function to be delegated to the worker thread

options Object

the api function's options

Source:
Returns:

see the corresponding public api functions for their return types

Type
Promise

getID() → {integer}

Get new request ID

Source:
Returns:

New unique request ID

Type
integer

(async) seedRandom(size)

Send message to worker with random data

Parameters:
Name Type Description
size Integer

Number of bytes to send

Source:

terminate()

Terminates the workers

Source: