def pool.join

bend-kit-concurrency@0.2.0.0 · concurrency.bend:205

import bend-kit-concurrency@0.2.0.0/concurrency.bend as Concurrency
import Base

205def pool.join(-A: Type, cs: List<Chan(A)>) -> IO(List<A>):
206  match cs:
207    case Nil{}:
208      IO.pure(List<A>, Nil{})
209    case c <> rest:
210      do IO<List<A>>:
211        x : A <- IO.join(A, c)
212        xs : List<A> <- pool.join(A, rest)
213        return x <> xs

Uses (6)

Used by (1)