rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
250 lines (109 loc) • 2.74 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [rc-js-util](./rc-js-util.md) > [WorkerPool](./rc-js-util.workerpool.md)
## WorkerPool class
A shared pool of web workers to run jobs off the main thread.
**Signature:**
```typescript
export declare class WorkerPool implements IWorkerPool
```
**Implements:** [IWorkerPool](./rc-js-util.iworkerpool.md)
## Remarks
If you know the number of threads you need, use `-sPTHREAD_POOL_SIZE=` to allocate them up front.
## Properties
<table><thead><tr><th>
Property
</th><th>
Modifiers
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[pointer](./rc-js-util.workerpool.pointer.md)
</td><td>
`readonly`
</td><td>
number
</td><td>
</td></tr>
<tr><td>
[resourceHandle](./rc-js-util.workerpool.resourcehandle.md)
</td><td>
`readonly`
</td><td>
[IManagedResourceNode](./rc-js-util.imanagedresourcenode.md)
</td><td>
</td></tr>
</tbody></table>
## Methods
<table><thead><tr><th>
Method
</th><th>
Modifiers
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[addJob(jobPtr)](./rc-js-util.workerpool.addjob.md)
</td><td>
</td><td>
</td></tr>
<tr><td>
[areWorkersSynced()](./rc-js-util.workerpool.areworkerssynced.md)
</td><td>
</td><td>
</td></tr>
<tr><td>
[createRoundRobin(wrapper, config, bindToReference, allocationFailThrows)](./rc-js-util.workerpool.createroundrobin.md)
</td><td>
`static`
</td><td>
</td></tr>
<tr><td>
[createRoundRobin(wrapper, config, bindToReference)](./rc-js-util.workerpool.createroundrobin_1.md)
</td><td>
`static`
</td><td>
</td></tr>
<tr><td>
[getWrapper()](./rc-js-util.workerpool.getwrapper.md)
</td><td>
</td><td>
</td></tr>
<tr><td>
[hasPendingWork()](./rc-js-util.workerpool.haspendingwork.md)
</td><td>
</td><td>
</td></tr>
<tr><td>
[invalidateBatch()](./rc-js-util.workerpool.invalidatebatch.md)
</td><td>
</td><td>
</td></tr>
<tr><td>
[isBatchDone()](./rc-js-util.workerpool.isbatchdone.md)
</td><td>
</td><td>
</td></tr>
<tr><td>
[isRunning()](./rc-js-util.workerpool.isrunning.md)
</td><td>
</td><td>
</td></tr>
<tr><td>
[setBatchEnd()](./rc-js-util.workerpool.setbatchend.md)
</td><td>
</td><td>
</td></tr>
<tr><td>
[start()](./rc-js-util.workerpool.start.md)
</td><td>
</td><td>
</td></tr>
<tr><td>
[stop()](./rc-js-util.workerpool.stop.md)
</td><td>
</td><td>
</td></tr>
</tbody></table>