Postgres.ready.loop: def of bend-kit-postgres@0.3.1.0 Import: import bend-kit-postgres@0.3.1.0/postgres.bend as Postgres Lines 210-234 of bend-kit-postgres@0.3.1.0/postgres.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-postgres@0.3.1.0/postgres.bend&start_line=210&end_line=234 import Base import bend-kit-postgres@0.3.1.0/codec.bend as Codec # BackendKeyData, then ReadyForQuery. def ready.loop(fuel: Nat, r: Result<&1, &1, Failure, Conn & Codec.Back>) -> IO(Result<&1, &1, Failure, Conn>): match fuel: case 0n: match r: case Fail{e}: IO.pure(Result<&1, &1, Failure, Conn>, Fail{e}) case Done{(c, m)}: abort(Conn, c, Malformed{}) case 1n+f: match r: case Fail{e}: IO.pure(Result<&1, &1, Failure, Conn>, Fail{e}) case Done{(c, m)}: match m: case Codec.ReadyForQuery{+status}: IO.pure(Result<&1, &1, Failure, Conn>, Done{set.status(c, status)}) case Codec.BackendKeyData{pid, key}: do IO>: m2 : Result<&1, &1, Failure, Conn & Codec.Back> <- read(c) ready.loop(f, m2) case Codec.ErrorResponse{fs}: reject(Conn, c, fs) case _: abort(Conn, c, Malformed{}) Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=bend-kit-postgres@0.3.1.0/codec.bend&name=Back https://jend.leeeet.dev/definition.txt?path=bend-kit-postgres@0.3.1.0/postgres.bend&name=Conn https://jend.leeeet.dev/definition.txt?path=bend-kit-postgres@0.3.1.0/postgres.bend&name=Failure https://jend.leeeet.dev/definition.txt?path=bend-kit-postgres@0.3.1.0/postgres.bend&name=abort https://jend.leeeet.dev/definition.txt?path=bend-kit-postgres@0.3.1.0/postgres.bend&name=read https://jend.leeeet.dev/definition.txt?path=bend-kit-postgres@0.3.1.0/postgres.bend&name=reject https://jend.leeeet.dev/definition.txt?path=bend-kit-postgres@0.3.1.0/postgres.bend&name=set.status