Io.http.web: def of ezmcp@0.1.0.0 Import: import ezmcp@0.1.0.0/src/io.bend as Io Lines 62-79 of ezmcp@0.1.0.0/src/io.bend: https://jend.leeeet.dev/read.txt?path=ezmcp@0.1.0.0/src/io.bend&start_line=62&end_line=79 import Base import emerging-ezjson@1.2.0.0/src/value.bend as Value import emerging-ezhttp@0.21.0.0/src/http.bend as Http import ezmcp@0.1.0.0/src/rpc.bend as Rpc import ezmcp@0.1.0.0/src/server.bend as Server import ezmcp@0.1.0.0/src/web.bend as Web # act on the transport's decision: reply now, or run the tool and reply # with its result, or run a batch's acts and reply with their replies def http.web( ~C: Data, ~run: C -> String -> Value.Json -> IO(Rpc.Out), +ctx: C, wid: Web.Web ) -> IO(Http.Reply): match wid: case Web.Now{status, headers, body}: IO.pure(Http.Reply, Http.Reply{status, headers, body}) case Web.Later{rev, id, name, args}: IO.bind(Rpc.Out, Http.Reply, run(ctx, name, args), out => IO.pure(Http.Reply, Web.reply(Web.ran(rev, id, out)))) case Web.Many{+rev, acts}: IO.bind(List<&2, Maybe<&2, Value.Json>>, Http.Reply, act.all(C, run, ctx, rev, acts), rs => IO.pure(Http.Reply, Web.reply(Web.many(Server.batch.reply(rs))))) Uses (15): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/http.bend&name=Reply https://jend.leeeet.dev/definition.txt?path=emerging-ezjson@1.3.0.0/src/value.bend&name=Json https://jend.leeeet.dev/definition.txt?path=ezmcp@0.1.0.0/src/io.bend&name=act.all https://jend.leeeet.dev/definition.txt?path=ezmcp@0.1.0.0/src/rpc.bend&name=Out https://jend.leeeet.dev/definition.txt?path=ezmcp@0.1.0.0/src/server.bend&name=batch.reply https://jend.leeeet.dev/definition.txt?path=ezmcp@0.1.0.0/src/web.bend&name=Web https://jend.leeeet.dev/definition.txt?path=ezmcp@0.1.0.0/src/web.bend&name=many https://jend.leeeet.dev/definition.txt?path=ezmcp@0.1.0.0/src/web.bend&name=ran https://jend.leeeet.dev/definition.txt?path=ezmcp@0.1.0.0/src/web.bend&name=reply