pool
Classes
Pool
Defined in: pool.ts:30
Unpacks tarballs into place.
Unpacking runs synchronously on the main thread, which is measurably faster than the async writers (the libuv round trip per file costs more than the IO).
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.
Constructors
new Pool()
new Pool(): PoolReturns
Methods
linkFromStore()
linkFromStore(
storeEntry,
target,
opts?): Promise<StoreLinkResult>Defined in: pool.ts:61
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): Promise<void>Defined in: pool.ts:35
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 |
Returns
Promise<void>
unpackFile()
unpackFile(
file,
target,
offset): Promise<void>Defined in: pool.ts:45
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 |
Returns
Promise<void>
unpackToStore()
unpackToStore(tarData, dir): Promise<{
index: StoreIndex;
}>Defined in: pool.ts:73
Explode a tarball into dir for the global store. See
unpackToStoreSync.
Parameters
| Parameter | Type |
|---|---|
tarData | Buffer |
dir | string |
Returns
Promise<{
index: StoreIndex;
}>