def http.serve_forever_from

ezmcp@0.1.0.0 · src/io.bend:188

import ezmcp@0.1.0.0/src/io.bend as Io
import Base
import emerging-ezjson@1.2.0.0/src/value.bend as Value
import emerging-ezhttp@0.21.0.0/main.bend as Ez
import ezmcp@0.1.0.0/src/rpc.bend as Rpc
import ezmcp@0.1.0.0/src/server.bend as Server

188# serve until the process is stopped, at most `max` connections at once
189# (0: no limit)
190@unsafe def http.serve_forever_from(
191  ~C: Data,
192  ~srv: C -> Server.Server,
193  ~run: C -> String -> Value.Json -> IO(Rpc.Out),
194  ~path: String,
195  ~origins: List<&2, String>,
196  +ctx: C,
197  host: String,
198  port: U32,
199  +max: U32
200) -> IO(Unit):
201  Ez.http.serve_forever_with(~C,
202    ~(c => req => http.answer_from(C, srv, run, path, origins, c, req)), ctx,
203    host, port, max)

Uses (10)

Used by (1)