def server.start.valid

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

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

6315def server.start.valid(~C: Data, ~O: Type, valid: Bool, context: C, owner: O, +config: ServerConfig) -> IO(O & Result<&2, &1, StartupError, Server<C>>):
6316  match valid:
6317    case False{}:
6318      IO.pure(O & Result<&2, &1, StartupError, Server<C>>, (owner, Fail{InvalidConfig{}}))
6319    case True{}:
6320      ServerConfig{host, port, body, headers, connections, requests, buffered, header_ms, body_ms, idle_ms, write_ms} = config
6321      do IO<O & Result<&2, &1, StartupError, Server<C>>>:
6322        result : Result<&1, &1, U32 & String, Listener> <- TCP.listen(host, port)
6323        server.started(~C, ~O, context, owner, config, result)

Uses (15)

Used by (1)