Examples and recipes
Start with the smallest example matching your task. Each repository contains runnable programs; the guides below explain the design choices around them.
By task
PUBLISH / SUBSCRIBEStream data
Telemetry, events, state, sensor values, images, and audio.
REQUEST / RESPONSECall a serviceCommands and queries with correlated replies and timeouts.
JSON-RPCDefine an APINamed methods, JSON Schema contracts, validation, and errors.
AI AGENTSExpose MCP toolsLet agents discover and call robot or edge capabilities.
PEER TO PEERUse WebRTCLow-latency data, RPC, browser video, and audio.
REMOTE ACCESSTunnel SSHReach systems behind NAT through an MQTT broker.
Runnable repositories
| Capability | Python | C++ | TypeScript / browser |
|---|---|---|---|
| ZeroMQ stream and RPC | Examples | Examples | — |
| MQTT stream and RPC | Examples | Examples | Examples |
| WebRTC | Examples | Examples | Browser demos |
| Schema RPC | Examples | Examples | Examples |
| MCP | Examples | Server example | Examples |
| Nodes | Examples | Examples | — |
| Discovery | Examples | Example | — |
Suggested learning sequence
- Run one writer and one reader on localhost.
- Replace streaming with RPC for a command that returns a result.
- Move both components to MQTT and confirm the application logic remains recognizable.
- Run different language implementations against the same topic or service.
- Add a schema and expose one safe method as an MCP tool.
- Use the CLI tools to inspect the finished deployment independently of your application.
Patterns worth copying
- One connection, many components: share MQTT and WebRTC connections within a process.
- Stable names: centralize topic, service, and session identifiers.
- Explicit shutdown: close components before shared connections.
- Timeouts everywhere: do not allow network calls to wait forever.
- Transport configuration outside behavior: load endpoints and credentials from deployment configuration.
- Test the wire: include at least one cross-language integration test for every shared contract.