def pool.h2.keep

bend-kit-http@0.38.4.0 · http.bend:3685

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

3685def pool.h2.keep(p: Pool, +key: String, res: Res, state: Bool & Conn) ->
3686    IO(Pool & Result<&1, &1, Err, Res>):
3687  (reusable, c) = state
3688  match reusable:
3689    case True{}:
3690      do IO<Pool & Result<&1, &1, Err, Res>>:
3691        next : Pool <- pool.give(p, key, c)
3692        return (next, Done{res})
3693    case False{}:
3694      do IO<Pool & Result<&1, &1, Err, Res>>:
3695        conn.close(c)
3696        return (p, Done{res})

Uses (15)

Used by (1)