Constructor
new Pool(size, worker)
Parameters:
Name | Type | Description |
---|---|---|
size |
Number | The size of the pool. Defaults to the number of CPUs
available. When this parameter is |
worker |
Worker | The decoder worker, loaded and initialised. Enables loading the worker using worker-loader(or others) externally when using this library as a webpack dependency. |
Methods
(async) decode(buffer) → {Promise.<ArrayBuffer>}
Decode the given block of bytes with the set compression method.
Parameters:
Name | Type | Description |
---|---|---|
buffer |
ArrayBuffer | the array buffer of bytes to decode. |
Returns:
the decoded result as a Promise
- Type
- Promise.<ArrayBuffer>