def http.serve_forever_with

ezmcp@0.1.0.0 · src/io.bend:132

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

132# serve until the process is stopped, at most `max` connections at once
133# (0: no limit)
134@unsafe def http.serve_forever_with(
135  ~C: Data,
136  ~run: C -> String -> Value.Json -> IO(Rpc.Out),
137  ~srv: Server.Server,
138  ~path: String,
139  ~origins: List<&2, String>,
140  +ctx: C,
141  host: String,
142  port: U32,
143  +max: U32
144) -> IO(Unit):
145  Ez.http.serve_forever_with(~C,
146    ~(c => req => http.answer(C, run, srv, path, origins, c, req)), ctx, host,
147    port, max)

Uses (10)

Used by (2)