libero/rpc

Client-side RPC machinery.

call_by_name is the low-level entrypoint used by Libero-generated stubs. It takes the WebSocket URL, the wire name, the args, and a wrap callback that produces the Lustre message to dispatch when the response arrives.

The JS FFI (rpc_ffi.mjs) auto-opens the WebSocket on first call and caches the connection. Calls issued before the socket is open are queued and flushed on the open event.

Developers don’t usually call this module directly. They import the per-module stubs the Libero generator writes into their client package, and those stubs internally delegate here.

Values

pub fn call_by_name(
  url url: String,
  name name: String,
  args args: args,
  wrap wrap: fn(result) -> msg,
) -> effect.Effect(msg)

Invoke a server RPC by wire name, with typed args and a wrap callback. Called by generated stubs.

The url is read from a generated rpc_config module in the consumer’s client package, not from this library, so each consumer can configure their own WebSocket endpoint.

Search Document