Http.stream.idle: def of bend-kit-http@0.38.2.0 Import: import bend-kit-http@0.38.2.0/http.bend as Http Lines 5002-5015 of bend-kit-http@0.38.2.0/http.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-http@0.38.2.0/http.bend&start_line=5002&end_line=5015 import Base import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes # An idle socket from the pool; an h2 session goes back, since a stream speaks HTTP/1.1. def stream.idle(p: Pool, +ms: U32, +head: Bool, +idem: Bool, +key: String, route: Route, r: Bytes.Bytes & Bytes.Bytes, c: Conn) -> IO(Pool & Result<&1, &1, Err, Stream>): (wire, spare) = r match c: case Conn{tls, s}: do IO>: x : Bool & Result<&1, &1, Err, Stream> <- stream.conn(Done{Conn{tls, s}}, ms, head, Some{key}, wire) stream.reused(p, ms, head, idem, key, route, spare, x) case ConnH2{s, client}: do IO>: next : Pool <- pool.give(p, key, ConnH2{s, client}) got : Result<&1, &1, Err, Stream> <- stream.fresh(ms, head, Some{key}, route, spare) return (next, got) Uses (20): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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=Maybe 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=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Conn https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Err https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Pool https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Route https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Stream https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=pool.give https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=stream.conn https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=stream.fresh https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=stream.reused