Lawtext core references • Docs
Lawtext core references / core/src/data/workersPool / WorkersPool
Class: WorkersPool<TInput, TResult>
Type Parameters
• TInput
• TResult
Constructors
new WorkersPool()
protected
new WorkersPool<TInput
,TResult
>(workersCount
,fileName
,workerOptions
,workers
):WorkersPool
<TInput
,TResult
>
Parameters
• workersCount: number
• fileName: string
| URL
• workerOptions: undefined
| WorkerOptions
• workers: Map
<number
, Worker
>
Returns
WorkersPool
<TInput
, TResult
>
Defined in
core/src/data/workersPool.ts:10 (opens in a new tab)
Properties
fileName
fileName:
string
|URL
Defined in
core/src/data/workersPool.ts:12 (opens in a new tab)
promises
protected
promises:Map
<number
,Promise
<[number
,number
,TInput
,TResult
]>>
Defined in
core/src/data/workersPool.ts:8 (opens in a new tab)
workerOptions
workerOptions:
undefined
|WorkerOptions
Defined in
core/src/data/workersPool.ts:13 (opens in a new tab)
workers
workers:
Map
<number
,Worker
>
Defined in
core/src/data/workersPool.ts:14 (opens in a new tab)
workersCount
workersCount:
number
Defined in
core/src/data/workersPool.ts:11 (opens in a new tab)
Methods
run()
run(
items
):AsyncIterable
<[number
,TInput
,TResult
]>
Parameters
• items: AsyncIterable
<TInput
>
Returns
AsyncIterable
<[number
, TInput
, TResult
]>
Defined in
core/src/data/workersPool.ts:47 (opens in a new tab)
unref()
unref():
void
Returns
void
Defined in
core/src/data/workersPool.ts:75 (opens in a new tab)
initialize()
static
initialize<TInput
,TResult
>(workersCount
,fileName
,workerOptions
?):Promise
<WorkersPool
<TInput
,TResult
>>
Type Parameters
• TInput
• TResult
Parameters
• workersCount: number
• fileName: string
| URL
• workerOptions?: WorkerOptions
Returns
Promise
<WorkersPool
<TInput
, TResult
>>