join-ports.ts 748 B

1234567891011121314
  1. // Promise.all over a static array literal: element positions become ports. One
  2. // element (x = element 0) feeds a downstream ask; the other (y = element 1) reaches
  3. // the sink. Additive relay: the join label AND the underlying producer both flow.
  4. // Expected:
  5. // ask#1 -> join#1 port=0, ask#2 -> join#1 port=1 (join in-taints)
  6. // join#1 -> ask#3 port=0, ask#1 -> ask#3 (x into ask#3; additive)
  7. // join#1 -> sink port=1, ask#2 -> sink (y into return; additive)
  8. // ask#3 -> sink (z into return)
  9. const [x, y] = await Promise.all([
  10. agent("first").ask<string>("A"),
  11. agent("second").ask<string>("B"),
  12. ]);
  13. const z = await agent("third").ask<string>(`use ${x}`);
  14. return `${y} ${z}`;