nori_asyncapi/codegen/gleam_server
Gleam server dispatcher generator.
Emits a transport-neutral runtime that turns incoming JSON frames into
typed handler calls and outgoing messages into JSON frames. It is not
coupled to any server library — feed dispatch each received text frame
(from Mist, or anything) and send the string that send_* returns.
Wire protocol: a { "type": "<MessageName>", "payload": <payload> }
envelope. type names the AsyncAPI message; payload is its schema.
Direction is from the server’s point of view: receive operations (client
→ server) become handler callbacks; send operations (server → client)
become send_* encoders.
Values
pub fn generate(
spec: ir.AsyncCodegenIR,
types_module: String,
) -> String
Generate the server dispatcher module. types_module is the import path of
the companion types module (e.g. "generated/types").