def serve.stream.feed

bend-kit-http@0.38.5.0 · http.bend:6557

import bend-kit-http@0.38.5.0/http.bend as Http
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

6557def serve.stream.feed(~S: Type, ~start: Req -> IO(S), ~piece: S -> Bytes.Bytes -> IO(S & Bool), req: Req, m: Maybe<&1, S & Bool>, parts: List<&1, Bytes.Bytes>) -> IO(S & Bool):
6558  match m:
6559    case None{}:
6560      do IO<S & Bool>:
6561        state : S <- start(req)
6562        serve.stream.parts(~S, ~piece, parts, (state, False{}))
6563    case Some{st}:
6564      serve.stream.parts(~S, ~piece, parts, st)

Uses (10)

Used by (1)