| base |
|
|
- |
| Farm.js |
|
4795 |
- |
| FifoQueue.js |
First-in, First-out task queue that manages a dedicated pool
for each worker as well as a shared queue. The FIFO ordering is guaranteed
across the worker specific and shared queue.
|
4215 |
- |
| index.js |
The Jest farm (publicly called "Worker") is a class that allows you to queue
methods across multiple child processes, in order to parallelize work. This
is done by providing an absolute path to a module that will be loaded on each
of the child processes, and bridged to the main process.
Bridged methods are specified by using the "exposedMethods" property of the
"options" object. This is an array of strings, where each of them corresponds
to the exported name in the loaded module.
You can also control the amount of workers by using the "numWorkers" property
of the "options" object, and the settings passed to fork the process through
the "forkOptions" property. The amount of workers defaults to the amount of
CPUS minus one.
Queueing calls can be done in two ways:
- Standard method: calls will be redirected to the first available worker,
so they will get executed as soon as they can.
- Sticky method: if a "computeWorkerKey" method is provided within the
config, the resulting string of this method will be used as a key.
Every time this key is returned, it is guaranteed that your job will be
processed by the same worker. This is specially useful if your workers
are caching results.
|
6471 |
- |
| PriorityQueue.js |
Priority queue that processes tasks in natural ordering (lower priority first)
accoridng to the priority computed by the function passed in the constructor.
FIFO ordering isn't guaranteed for tasks with the same priority.
Worker specific tasks with the same priority as a non-worker specific task
are always processed first.
|
4809 |
- |
| types.js |
|
1499 |
- |
| WorkerPool.js |
|
1190 |
- |
| workers |
|
|
- |