def serve.stream.on.with

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

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

7084def serve.stream.on.with(
7085  ~S: Type, ~start: Req -> IO(S), ~piece: S -> Bytes.Bytes -> IO(S & Bool),
7086  ~finish: S -> IO(Reply), ~abort: S -> StreamAbort -> IO(Unit), ~observe: U32 -> Completion.Outcome -> IO(Unit), host: String, +port: U32, +max: Nat
7087) -> IO(Unit):
7088  do IO<Unit>:
7089    limits.validate(max)
7090    result : Result<&2, &2, StartupError, Unit> <-
7091      serve.stream.config(~S, ~start, ~piece, ~finish, ~abort, ~observe, server.config.with(host, port, max))
7092    serve.config.result(result)

Uses (19)

Used by (1)