def try.stream

bend-kit-hairpin@0.14.0.0 · hairpin.bend:317

import bend-kit-hairpin@0.14.0.0/hairpin.bend as Hairpin
import Base
import bend-kit-http@0.38.1.1/http.bend as Http
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

317# One attempt that opens a stream on the pool: the redirect loop with the mode, the jar, and the certificate,
318# then the body decoded by enc.
319def try.stream(o: Opts, call: Call, pool: Http.Pool, jar: Maybe<&2, Http.Jar>, body: Bytes.Bytes) ->
320    IO(Http.Pool & Maybe<&2, Http.Jar> & Result<&1, &1, Http.Err, Http.Stream>):
321  Opts{base, h, +ms, mode, p, cert, ca} = o
322  Call{+enc, method, u, headers} = call
323  do IO<Http.Pool & Maybe<&2, Http.Jar> & Result<&1, &1, Http.Err, Http.Stream>>:
324    now : Maybe<&2, Http.Jar> <- jar.now(jar)
325    r : Http.Pool & Maybe<&2, Http.Jar> & Result<&1, &1, Http.Err, Http.Stream> <-
326      Http.stream.hops(mode, ms, (pool, Http.StreamHops{Http.stream.start(method, Http.accept.enc(headers, enc), body, u), cert, now, ca}))
327    Http.stream.init.pool(enc, r)

Uses (19)

Used by (1)