def Stream.fold

bend-kube-runtime@0.2.0.0 · src/stream.bend:139

import bend-kube-runtime@0.2.0.0/src/stream.bend as Stream
import Base
import bend-kube-runtime@0.2.0.0/src/http.bend as H
import bend-kube-runtime@0.2.0.0/src/net.bend as N
import bend-kube-runtime@0.2.0.0/src/config.bend as K
import bend-kube-runtime@0.2.0.0/src/client.bend as Cl

139# GETs path (with its query) and folds each cut of the body into st with
140# on, in order, until the body ends: Done with the last state. ms bounds
141# each wait for bytes (0: none; a followed log may stay quiet for long).
142def Stream.fold(~S: Type, ~on: S -> List<&2, U32> -> IO(S), st: S, +cfg: K.Config, path: String,
143  +ms: U32) -> IO(Res(S)):
144  IO.bind(Result<&1, &1, U32 & String, N.Tls>, Res(S),
145    Cl.Conn.open(cfg, H.Req{"GET", path, Nil{}, ""}, False{}), t => Stream.opened(~S, ~on, st, t, ms))

Uses (14)

Used by (0)

No other definition uses this definition.