@vltpkg/tar 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -61,8 +61,9 @@ Queue of requests awaiting an available worker.
61
61
 
62
62
  #### `pool.pending`
63
63
 
64
- Unpack requests that have been assigned to a worker, but not yet
65
- completed.
64
+ All unpack requests that have not yet completed, both those currently
65
+ assigned to a worker and those still waiting in the queue. Entries are
66
+ removed once the request resolves or rejects.
66
67
 
67
68
  #### `pool.unpack(tarData: Buffer, target: string) => Promise<void>`
68
69
 
package/dist/pool.d.ts CHANGED
@@ -12,8 +12,8 @@ export * from './worker.ts';
12
12
  export declare class Pool {
13
13
  #private;
14
14
  /**
15
- * Number of workers to emplly. Defaults to 1 less than the number of
16
- * CPUs, or 1.
15
+ * Number of workers to employ. Defaults to 8 times one less than
16
+ * the number of available CPUs, with a minimum of 8.
17
17
  */
18
18
  jobs: number;
19
19
  /**
@@ -25,8 +25,10 @@ export declare class Pool {
25
25
  */
26
26
  queue: UnpackRequest[];
27
27
  /**
28
- * Requests that have been assigned to a worker, but have not yet
29
- * been confirmed completed.
28
+ * All requests that have not yet been confirmed completed, both
29
+ * those currently assigned to a worker and those still waiting in
30
+ * the queue. Entries are removed once the request resolves or
31
+ * rejects, releasing the reference to its tarball buffer.
30
32
  */
31
33
  pending: Map<number, UnpackRequest>;
32
34
  /**
package/dist/pool.js CHANGED
@@ -14,8 +14,8 @@ export * from "./worker.js";
14
14
  */
15
15
  export class Pool {
16
16
  /**
17
- * Number of workers to emplly. Defaults to 1 less than the number of
18
- * CPUs, or 1.
17
+ * Number of workers to employ. Defaults to 8 times one less than
18
+ * the number of available CPUs, with a minimum of 8.
19
19
  */
20
20
  /* c8 ignore next */
21
21
  jobs = 8 * (Math.max(os.availableParallelism(), 2) - 1);
@@ -28,8 +28,10 @@ export class Pool {
28
28
  */
29
29
  queue = [];
30
30
  /**
31
- * Requests that have been assigned to a worker, but have not yet
32
- * been confirmed completed.
31
+ * All requests that have not yet been confirmed completed, both
32
+ * those currently assigned to a worker and those still waiting in
33
+ * the queue. Entries are removed once the request resolves or
34
+ * rejects, releasing the reference to its tarball buffer.
33
35
  */
34
36
  pending = new Map();
35
37
  // handle a message from the worker
@@ -41,6 +43,8 @@ export class Pool {
41
43
  /* c8 ignore next */
42
44
  if (!ur)
43
45
  return;
46
+ // request is done, stop holding its tarball buffer in memory
47
+ this.pending.delete(id);
44
48
  if (isResponseOK(m)) {
45
49
  ur.resolve();
46
50
  /* c8 ignore start - nearly impossible in normal circumstances */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vltpkg/tar",
3
3
  "description": "An extremely limited and very fast tar extractor",
4
- "version": "1.0.4",
4
+ "version": "1.0.5",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -13,8 +13,8 @@
13
13
  "url": "http://vlt.sh"
14
14
  },
15
15
  "dependencies": {
16
- "@vltpkg/error-cause": "1.0.4",
17
- "@vltpkg/types": "1.0.4",
16
+ "@vltpkg/error-cause": "1.0.5",
17
+ "@vltpkg/types": "1.0.5",
18
18
  "rimraf": "^6.1.2",
19
19
  "tar": "^7.5.2"
20
20
  },