@operad-io/pool 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/index.ts +6 -2
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@operad-io/pool",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts"
7
7
  },
8
8
  "dependencies": {
9
- "@operad-io/engine": "0.1.0"
9
+ "@operad-io/engine": "0.1.1"
10
10
  },
11
11
  "description": "operad: the pool plugin, workers shared by runs",
12
12
  "repository": {
package/src/index.ts CHANGED
@@ -275,11 +275,15 @@ export function createPoolPlugin(options: PoolPluginOptions = {}) {
275
275
  const first = await attempt(ctx, prefix, candidates, params, options);
276
276
  if (first.kind === "aborted") return interrupted();
277
277
  const name = first.worker.fallback;
278
+ // A throw is not a trigger: the harness reports a process that
279
+ // cannot start as a failed result with reason `missing` or `spawn`,
280
+ // and anything else thrown is the step's own error. It fails the
281
+ // work, as it does when the worker has no fallback.
278
282
  const triggered =
279
283
  name !== undefined &&
280
284
  !ctx.signal.aborted &&
281
- (first.kind === "threw" ||
282
- modelUnavailable(first.result.data) ||
285
+ first.kind === "result" &&
286
+ (modelUnavailable(first.result.data) ||
283
287
  (first.result.result === "failed" && harnessDidNotStart(first.result.data)));
284
288
  if (!triggered) {
285
289
  if (first.kind === "threw") throw first.error;