var {*} = import("slug.channel")
nursery fn fetchAll(ids) {
var tasks = ids /> map(fn(id) { spawn { fetchUser(id) } })
tasks /> map(fn(t) { await(t) })
}
This is the cleanest “fan-out/fan-in” shape for N items.
var {*} = import("slug.channel")
nursery fn fetchAll(ids) {
var tasks = ids /> map(fn(id) { spawn { fetchUser(id) } })
tasks /> map(fn(t) { await(t) })
}
This is the cleanest “fan-out/fan-in” shape for N items.