@gesslar/actioneer 0.2.1 → 0.2.3

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.
@@ -8,17 +8,15 @@ export default class Piper {
8
8
  debug?: (message: string, level?: number, ...args: Array<unknown>) => void;
9
9
  })
10
10
  /**
11
- * Add a processing step to the pipeline.
12
- * Each step is executed sequentially per item.
11
+ * Add a processing step to the pipeline
13
12
  *
14
13
  * @param {(context: unknown) => Promise<unknown>|unknown} fn Function that processes an item
15
- * @param {{name: string, required?: boolean}} options Step options (name is required)
14
+ * @param {{name?: string, required?: boolean}} [options] Step options
16
15
  * @param {unknown} [newThis] Optional this binding
17
16
  * @returns {Piper} The pipeline instance (for chaining)
18
- * @throws {Sass} If name is not provided in options
19
17
  */
20
18
  addStep(fn: (context: unknown) => Promise<unknown> | unknown, options?: {
21
- name: string;
19
+ name?: string;
22
20
  required?: boolean;
23
21
  }, newThis?: unknown): Piper
24
22
  /**
@@ -38,28 +36,13 @@ export default class Piper {
38
36
  */
39
37
  addCleanup(fn: () => Promise<void> | void, thisArg?: unknown): Piper
40
38
  /**
41
- * Process items through the pipeline with concurrency control using a worker pool pattern.
42
- * Workers are spawned up to maxConcurrent limit, and as workers complete, new workers
43
- * are spawned to maintain concurrency until all items are processed.
44
- *
45
- * This implementation uses dynamic worker spawning to maintain concurrency:
46
- * - Initial workers are spawned up to maxConcurrent limit
47
- * - As each worker completes (success OR failure), a replacement worker is spawned if items remain
48
- * - Worker spawning occurs in finally block to ensure resilience to individual worker failures
49
- * - All results are collected with {ok, value} or {ok: false, error} structure
50
- * - Processing continues even if individual workers fail, collecting all errors
39
+ * Process items through the pipeline with concurrency control
51
40
  *
52
41
  * @param {Array<unknown>|unknown} items - Items to process
53
- * @param {number} [maxConcurrent] - Maximum concurrent items to process (default: 10)
54
- * @returns {Promise<Array<{ok: boolean, value?: unknown, error?: Sass}>>} - Results with success/failure status
55
- * @throws {Sass} If setup or teardown fails
42
+ * @param {number} maxConcurrent - Maximum concurrent items to process
43
+ * @returns {Promise<Array<unknown>>} - Collected results from steps
56
44
  */
57
- pipe(items: Array<unknown> | unknown, maxConcurrent?: number): Promise<Array<{
58
- ok: boolean;
59
- value?: unknown;
60
- error?: Sass;
61
- }>>
45
+ pipe(items: Array<unknown> | unknown, maxConcurrent?: number): Promise<Array<unknown>>
62
46
  #private
63
47
  }
64
- import { Sass } from '@gesslar/toolkit'
65
48
  //# sourceMappingURL=Piper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Piper.d.ts","sourceRoot":"","sources":["../../lib/Piper.js"],"names":[],"mappings":"AAaA;IAWE;;;;OAIG;IACH,wBAFW;QAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CAAA;KAAC,EAItF;IAED;;;;;;;;;OASG;IACH,YANW,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,GAAC,OAAO,YAC9C;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAC,YAClC,OAAO,GACL,KAAK,CAejB;IAED;;;;;;OAMG;IACH,aAJW,MAAM,OAAO,CAAC,IAAI,CAAC,GAAC,IAAI,YACxB,OAAO,GACL,KAAK,CAMjB;IAED;;;;;;OAMG;IACH,eAJW,MAAM,OAAO,CAAC,IAAI,CAAC,GAAC,IAAI,YACxB,OAAO,GACL,KAAK,CAMjB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,YALW,KAAK,CAAC,OAAO,CAAC,GAAC,OAAO,kBACtB,MAAM,GACJ,OAAO,CAAC,KAAK,CAAC;QAAC,EAAE,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,IAAI,CAAA;KAAC,CAAC,CAAC,CAqFxE;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