order-unawaited-one-actor.ts 422 B

12345678
  1. // Two un-awaited asks on ONE actor, joined at the end: the `Promise.all` does NOT
  2. // parallelize them, because the actor's mailbox serializes them. Expect a `fifo` edge
  3. // ask#1 -> ask#2 — an arrow where the script suggests concurrency.
  4. const critic = agent("critic");
  5. const p1 = critic.ask<string>("assess A");
  6. const p2 = critic.ask<string>("assess B");
  7. const [a, b] = await Promise.all([p1, p2]);
  8. return `${a} ${b}`;