pool
Classes
Pool
Defined in: tar/src/pool.ts:48
Unpacks tarballs into place.
Decompression runs on libuv's threadpool, so packages inflate in
parallel; the files are then written synchronously on the main
thread, which is measurably faster than the async writers (the libuv
round trip per file costs more than the IO). VLT_TAR_SYNC switches
that pairing; see the constant above.
There is no queue here. The only limiter is the caller's: reify caps
extraction at Math.max(availableParallelism() - 1, 1) * 8 in flight
(@vltpkg/graph, src/reify/index.ts). A consumer that is not reify
is unbounded -- add your own cap. How many inflate at once is capped
lower and elsewhere, by UV_THREADPOOL_SIZE (4 by default).
Constructors
new Pool()
new Pool(): PoolReturns
Methods
linkFromStore()
linkFromStore(
storeEntry,
target,
opts?): Promise<StoreLinkResult>Defined in: tar/src/pool.ts:92
Hardlink (or copy) a global store entry into target. Resolves
how, with the index, or false on a store miss. See
linkFromStore.
Parameters
| Parameter | Type |
|---|---|
storeEntry | string |
target | string |
opts? | LinkFromStoreOptions |
Returns
Promise<StoreLinkResult>
unpack()
unpack(
tarData,
target,
format?): Promise<void>Defined in: tar/src/pool.ts:53
Provide the tardata to be unpacked, and the location where it's to be placed. Resolves when the tarball has been extracted.
Parameters
| Parameter | Type |
|---|---|
tarData | Buffer |
target | string |
format? | TarballFormat |
Returns
Promise<void>
unpackFile()
unpackFile(
file,
target,
offset,
format?): Promise<void>Defined in: tar/src/pool.ts:68
Same, reading the tarball from a file and skipping offset leading
bytes, so a cache entry is unpacked without loading it into the
registry client's in-memory cache.
Parameters
| Parameter | Type | Default value |
|---|---|---|
file | string | undefined |
target | string | undefined |
offset | number | 0 |
format? | TarballFormat | undefined |
Returns
Promise<void>
unpackToStore()
unpackToStore(
tarData,
dir,
format?): Promise<{
index: StoreIndex;
}>Defined in: tar/src/pool.ts:104
Explode a tarball into dir for the global store. See
unpackToStoreSync.
Parameters
| Parameter | Type |
|---|---|
tarData | Buffer |
dir | string |
format? | TarballFormat |
Returns
Promise<{
index: StoreIndex;
}>