def pool.give.of

bend-kit-http@0.38.2.0 · http.bend:2737

import bend-kit-http@0.38.2.0/http.bend as Http
import Base

2737def pool.give.of(+cap: U32, +key: String, c: Conn, limit: Nat,
2738    r: Map<&1, List<&1, Conn>> & Maybe<&1, List<&1, Conn>>) -> IO(Pool):
2739  (m, old) = r
2740  do IO<Pool>:
2741    xs : List<&1, Conn> <- conns.cut(c <> Maybe.default(&1, List<&1, Conn>, old, Nil{}), limit)
2742    return Pool{cap, Map.set(&1, List<&1, Conn>, m, key, xs)}

Uses (16)

Used by (1)