One module describes a GenServer's remote-callable operations for both
sides. The server side (Snodo.OTP.Server.expose/2) turns it into
Snodo.Tool.GenServer declarations: JSON in, Elixir message, reply term,
JSON out. The client side (Snodo.OTP.Proxy) uses the inverse pair:
Elixir message in, JSON out over the wire, JSON reply back to a term.
Nothing is inferred. An operation exists because the contract names it, with its schema, which keeps the boundary the GenServer tool experiment settled on: a client never chooses a process, atom or term.
Summary
Callbacks
Server side: validated JSON arguments to the GenServer message.
Client side: the JSON reply object back to the term the caller expects.
Client side: a GenServer.call message to an operation and JSON arguments, or :nomatch.
Client side: a GenServer.cast message to an operation and JSON arguments, or :nomatch.
Server side: the GenServer reply to a JSON object.
The operations, in catalog order.
Types
@type op() :: %{ :name => String.t(), :kind => :call | :cast, :input_schema => map(), optional(:output_schema) => map(), optional(:description) => String.t(), optional(:timeout) => pos_integer() }
Callbacks
Server side: validated JSON arguments to the GenServer message.
Client side: the JSON reply object back to the term the caller expects.
Client side: a GenServer.call message to an operation and JSON arguments, or :nomatch.
Client side: a GenServer.cast message to an operation and JSON arguments, or :nomatch.
Server side: the GenServer reply to a JSON object.
@callback ops() :: [op()]
The operations, in catalog order.