1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | import { FarmOptions } from './types';
|
8 | export default class Farm {
|
9 | private _computeWorkerKey;
|
10 | private _cacheKeys;
|
11 | private _callback;
|
12 | private _last;
|
13 | private _locks;
|
14 | private _numOfWorkers;
|
15 | private _offset;
|
16 | private _queue;
|
17 | constructor(numOfWorkers: number, callback: Function, computeWorkerKey?: FarmOptions['computeWorkerKey']);
|
18 | doWork(method: string, ...args: Array<any>): Promise<unknown>;
|
19 | private _getNextTask;
|
20 | private _process;
|
21 | private _enqueue;
|
22 | private _push;
|
23 | private _lock;
|
24 | private _unlock;
|
25 | private _isLocked;
|
26 | }
|