def serve
import bend-kit-camber@0.15.0.1/camber.bend as Camberimport Base
import bend-kit-http@0.38.1.1/http.bend as Http
import bend-kit-http@0.38.1.1/completion.bend as TransportCompletion
import bend-kit-camber@0.15.0.1/notices.bend as Notices
1263# Owners that need readiness/control use server.start then server.run instead.
1264def serve(~A: Data, ~S: Type, ~K: Data, ~E: Data, ~H: Data,
1265 ~before_hook: H -> S -> K -> Metadata -> IO(Step<S, E>),
1266 ~after_hook: H -> S -> K -> Http.Res -> IO(S & Result<&2, &1, Error<E>, Http.Res>),
1267 ~run: A -> S -> K -> Match<Policy<H>> -> Http.Req -> IO(S & Result<&2, &1, Error<E>, Http.Res>),
1268 ~mapper: S -> K -> Error<E> -> IO(S & Result<&2, &1, Error<E>, Http.Res>),
1269 ~destroy: S -> IO(Unit),
1270 ~done: TransportCompletion.Completion<ApplicationReport<H>> -> IO(Unit),
1271 ~observe: U32 -> TransportCompletion.Outcome -> IO(Unit),
1272 ~notify: K -> Policy<H> -> Notices.Notice -> IO(Result<&2, &2, E, Unit>),
1273 ~report: K -> E -> IO(Unit), ~access: K -> Notices.Access,
1274 registration: Result<&2, &2, RegistrationError, Application<A, K, Policy<H>>>,
1275 config: Http.ServerConfig, resources: List<S>
1276) -> IO(Result<&2, &1, StartupError, ServerExit<A, S, K, H>>):
1277 do IO<Result<&2, &1, StartupError, ServerExit<A, S, K, H>>>:
1278 started : Result<&2, &1, StartupError, Server<A, S, K, H>> <-
1279 server.start(~A, ~S, ~K, ~E, ~H, ~before_hook, ~after_hook, ~run, ~mapper, ~destroy, registration, config, resources)
1280 serve.started(~A, ~S, ~K, ~H, ~E, ~done, ~observe, ~notify, ~report, ~access, started)
Uses (27)
Used by (0)
No other definition uses this definition.