Lawtext core references / core/src/data/workersPool / WorkersPool
Class: WorkersPool<TInput, TResult>
Defined in: core/src/data/workersPool.ts:7 (opens in a new tab)
Type Parameters
• TInput
• TResult
Constructors
new WorkersPool()
protected
new WorkersPool<TInput
,TResult
>(workersCount
,fileName
,workerOptions
,workers
):WorkersPool
<TInput
,TResult
>
Defined in: core/src/data/workersPool.ts:10 (opens in a new tab)
Parameters
workersCount
number
fileName
string
| URL
workerOptions
undefined
| WorkerOptions
workers
Map
<number
, Worker
>
Returns
WorkersPool
<TInput
, TResult
>
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
]>
Defined in: core/src/data/workersPool.ts:47 (opens in a new tab)
Parameters
items
AsyncIterable
<TInput
>
Returns
AsyncIterable
<[number
, TInput
, TResult
]>
unref()
unref():
void
Defined in: core/src/data/workersPool.ts:75 (opens in a new tab)
Returns
void
initialize()
static
initialize<TInput
,TResult
>(workersCount
,fileName
,workerOptions
?):Promise
<WorkersPool
<TInput
,TResult
>>
Defined in: core/src/data/workersPool.ts:17 (opens in a new tab)
Type Parameters
• TInput
• TResult
Parameters
workersCount
number
fileName
string
| URL
workerOptions?
WorkerOptions
Returns
Promise
<WorkersPool
<TInput
, TResult
>>