// Pipeline of streaming moroutines, each step on its own dedicated worker. // Data flows: generate → double → square → toString, all via MessageChannel. // Requires Node v24+. // // Run: node examples/pipeline/main.ts import { generate, double, square, toString } from './steps.ts'; const numbers = generate(5); const doubled = double(numbers); const squared = square(doubled); const labels = toString(squared); for await (const label of labels) { console.log(label); } // => 4 // => 16 // => 36 // => 64 // => 100