Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[6a3a178] | 1 | /**
|
---|
| 2 | * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
---|
| 3 | *
|
---|
| 4 | * This source code is licensed under the MIT license found in the
|
---|
| 5 | * LICENSE file in the root directory of this source tree.
|
---|
| 6 | */
|
---|
| 7 | import { FarmOptions, PromiseWithCustomMessage, TaskQueue } from './types';
|
---|
| 8 | export default class Farm {
|
---|
| 9 | private _numOfWorkers;
|
---|
| 10 | private _callback;
|
---|
| 11 | private readonly _computeWorkerKey;
|
---|
| 12 | private readonly _workerSchedulingPolicy;
|
---|
| 13 | private readonly _cacheKeys;
|
---|
| 14 | private readonly _locks;
|
---|
| 15 | private _offset;
|
---|
| 16 | private readonly _taskQueue;
|
---|
| 17 | constructor(_numOfWorkers: number, _callback: Function, options?: {
|
---|
| 18 | computeWorkerKey?: FarmOptions['computeWorkerKey'];
|
---|
| 19 | workerSchedulingPolicy?: FarmOptions['workerSchedulingPolicy'];
|
---|
| 20 | taskQueue?: TaskQueue;
|
---|
| 21 | });
|
---|
| 22 | doWork(method: string, ...args: Array<unknown>): PromiseWithCustomMessage<unknown>;
|
---|
| 23 | private _process;
|
---|
| 24 | private _push;
|
---|
| 25 | private _getNextWorkerOffset;
|
---|
| 26 | private _lock;
|
---|
| 27 | private _unlock;
|
---|
| 28 | private _isLocked;
|
---|
| 29 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.