I’ll often write a parallel map as something like
results = map(x -> @spawn foo(x), inputs) .|> fetch
So the map returns a collection of Tasks, which is then broadcasted into fetch to wait for and retrieve each of the results into a new collection.