mirror of
https://github.com/lovell/sharp.git
synced 2025-07-13 04:20:12 +02:00
Improve documentation on concurrency/parallelism
This commit is contained in:
parent
d3225fa193
commit
926c5603aa
@ -464,7 +464,7 @@ sharp.cache(50, 200); // { current: 49, high: 99, memory: 50, items: 200}
|
|||||||
|
|
||||||
#### sharp.concurrency([threads])
|
#### sharp.concurrency([threads])
|
||||||
|
|
||||||
`threads`, if provided, is the Number of threads _libvips'_ should create for image processing. The default value is the number of CPU cores. A value of `0` will reset to this default.
|
`threads`, if provided, is the Number of threads _libvips'_ should create for processing each image. The default value is the number of CPU cores. A value of `0` will reset to this default.
|
||||||
|
|
||||||
This method always returns the current concurrency.
|
This method always returns the current concurrency.
|
||||||
|
|
||||||
@ -474,6 +474,8 @@ sharp.concurrency(2); // 2
|
|||||||
sharp.concurrency(0); // 4
|
sharp.concurrency(0); // 4
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The maximum number of images that can be processed in parallel is limited by libuv's `UV_THREADPOOL_SIZE` environment variable.
|
||||||
|
|
||||||
#### sharp.counters()
|
#### sharp.counters()
|
||||||
|
|
||||||
Provides access to internal task counters.
|
Provides access to internal task counters.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user