Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

GitHub

This documentation is part of the "Projects with Books" initiative at zenOSmosis.

The source code for this project is available on GitHub.

Glossary

Loading…

Glossary

Relevant source files

This page provides definitions for the specific terminology, abbreviations, and domain concepts used within the Muxio framework. Muxio uses a layered architecture where concepts from the low-level framing layer are composed to build high-level RPC abstractions.

Core Concepts & Jargon

Binary-First / Framed Transport

Muxio operates on raw byte streams rather than text-based formats like JSON README.md:33-34 Data is transmitted in discrete, ordered chunks called Frames. This approach allows for zero-assumption serialization (e.g., bitcode, FlatBuffers, or raw f32 arrays) DRAFT.md:11-13

Bidirectional Symmetry

Unlike traditional HTTP where roles are strictly Requestor (Client) and Responder (Server), Muxio allows both ends of a connection to act as both a client and a server simultaneously DRAFT.md:15-16 A “Client” in Muxio can register handlers to receive calls from the “Server” via the RpcServiceEndpointInterface extensions/muxio-rpc-service-endpoint/src/endpoint_interface.rs:1-12

Layered Transport Kit

A design philosophy where the core logic is written in a non-async, callback-driven style DRAFT.md:43-48 This allows the same core multiplexing logic to be wrapped by different “Transport Kits” like Tokio for native apps or wasm-bindgen for web browsers README.md:35-41

Sources: README.md:17-41 DRAFT.md:11-16 DRAFT.md:43-48


Technical Terms

TermDefinitionKey Code Entity
DispatcherThe central coordinator that manages stream lifecycles, request correlation, and response handling.RpcDispatcher extensions/muxio-rpc-service-caller/src/caller_interface.rs28
EndpointA registry for RPC method handlers. It maps method_id to asynchronous logic.RpcServiceEndpoint extensions/muxio-rpc-service-endpoint/src/endpoint.rs:1-10
FrameThe smallest unit of data transmission, containing a header and a payload chunk.Frame muxio-core/src/frame/mod.rs
Method IDA unique u64 identifier for an RPC function, typically generated via xxh3 hashing at compile time.rpc_method_id! extensions/muxio-rpc-service/src/lib.rs
PrebufferedA communication pattern where the entire payload (request or response) is collected into a single buffer before being passed to the handler or caller.RpcMethodPrebuffered extensions/muxio-rpc-service-caller/src/prebuffered/traits.rs11
RPC SessionAn internal state tracker that manages unique rpc_request_id allocation and stream event routing.RpcRespondableSession muxio-core/src/rpc/mod.rs
Dynamic ChannelAn abstraction over bounded and unbounded mpsc channels used for streaming RPC responses.DynamicChannel extensions/muxio-rpc-service-caller/src/dynamic_channel.rs:6-10

Sources: extensions/muxio-rpc-service-caller/src/caller_interface.rs:25-30 extensions/muxio-rpc-service-caller/src/prebuffered/traits.rs:11-21 extensions/muxio-rpc-service-caller/src/dynamic_channel.rs:1-10


Data Flow & Architecture Diagrams

The following diagrams illustrate how natural language concepts map to specific code entities and how data flows through the system.

Request Lifecycle: From Caller to Transport

This diagram bridges the “Natural Language Space” of making a call to the “Code Entity Space” of encoders and emitters.

graph TD
    User["User Code"] -- "1. call(input)" --> RPCBP["RpcCallPrebuffered::call"]
RPCBP -- "2. encode" --> RM["RpcMethodPrebuffered::encode_request"]
RPCBP -- "3. dispatch" --> RSCI["RpcServiceCallerInterface::call_rpc_streaming"]
RSCI -- "4. init" --> DISP["RpcDispatcher (Core)"]
DISP -- "5. encode frame" --> RSE["RpcStreamEncoder"]
RSE -- "6. emit bytes" --> EMIT["RpcEmit (Callback)"]
EMIT -- "7. write" --> SOCK["Underlying Transport (Tokio/WASM)"]
subgraph "muxio-rpc-service-caller"
        RPCBP
        RSCI
    end

    subgraph "muxio-core"
        DISP
        RSE
    end

Title: RPC Call Invocation Flow

Sources: extensions/muxio-rpc-service-caller/src/caller_interface.rs:33-89 extensions/muxio-rpc-service-caller/src/prebuffered/traits.rs:50-81

Endpoint Pipeline: From Bytes to Handler

This diagram shows the pipeline used by the RpcServiceEndpoint to process incoming data, specifically how it integrates with the WASM client.

graph LR
    Bytes["&[u8] from JS/Transport"] --> Read["RpcWasmClient::read_bytes"]
subgraph "RpcServiceEndpoint::read_bytes"
        Read -- "1. decode" --> DISP["RpcDispatcher::read_bytes"]
DISP -- "2. finalized" --> EP["RpcServiceEndpoint"]
EP -- "3. execute" --> Handlers["Async Prebuffered Handlers"]
Handlers -- "4. respond" --> OutBytes["Outbound Bytes (emit)"]
end

 
   OutBytes --> JS["JS static_muxio_write_bytes"]

Title: Endpoint Read Bytes Pipeline

Sources: extensions/muxio-wasm-rpc-client/src/rpc_wasm_client.rs:46-55 extensions/muxio-rpc-service-endpoint/tests/prebuffered_endpoint_tests.rs:71-74


Key Abbreviations

  • FFI : Foreign Function Interface. Muxio’s byte-oriented design facilitates bridging Rust with JS (via WASM) or C/C++ README.md:62-63
  • ID (u32/u64) :
  • WASM : WebAssembly. Specifically refers to the muxio-wasm-rpc-client which uses a bridge to communicate with JavaScript README.md53

System State Definitions

RpcTransportState

Represents the connectivity status of a caller interface extensions/muxio-rpc-service-caller/src/transport_state.rs:1-10

RpcStreamEvent

The internal signaling mechanism used by the RpcSession to notify the RpcDispatcher of progress extensions/muxio-rpc-service-caller/src/caller_interface.rs:123-163

Sources: extensions/muxio-rpc-service-caller/src/caller_interface.rs:123-163 extensions/muxio-tokio-rpc-client/src/rpc_client.rs:80-108 extensions/muxio-wasm-rpc-client/src/rpc_wasm_client.rs:58-68