def serve.stream.feed

bend-kit-http@0.38.2.0 · http.bend:6565

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

6565def 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):
6566  match m:
6567    case None{}:
6568      do IO<S & Bool>:
6569        state : S <- start(req)
6570        serve.stream.parts(~S, ~piece, parts, (state, False{}))
6571    case Some{st}:
6572      serve.stream.parts(~S, ~piece, parts, st)

Uses (10)

Used by (1)