roboflex.transport.zenoh
Roboflex transport nodes powered by Zenoh. Zenoh gives us pub/sub plus automatic discovery, so we can move roboflex messages across threads, processes, and machines without needing to manage a broker manually.
any node -> ZenohPublisher ==THE_NETWORK==> ZenohSubscriber -> any node
Status
This transport mirrors the ZMQ/MQTT bindings but uses zenoh-c under the hood, with Zenoh discovery/scouting enabled by default. Nodes:
ZenohPublisher: publishes rawroboflexmessages to a Zenoh key expression.ZenohSubscriber: subscribes to a key expression and signals incoming messages. It runs its own thread (callstart()).ZenohRequestClient: sends one roboflex message as a Zenoh query payload and blocks for a reply.ZenohRequestServer: declares a Zenoh queryable and replies with handler-returned roboflex messages.
Build (C++)
mkdir build && cd build
cmake ..
make
Python bindings are off by default for plain C++ CMake builds. To build them with CMake directly:
cmake -S . -B build -DBUILD_ROBOFLEX_TRANSPORT_ZENOH_PYTHON_EXT=ON
Run Tests
Tests are plain C++ executables registered with CTest; no separate testing library is required.
cmake -S . -B build
cmake --build build --target test_zenoh_transport
ctest --test-dir build --output-on-failure
If Zenoh cannot open a local session in the current environment, the runtime test exits with CTest's configured skip code instead of failing the build.
Example
See examples/pub_sub_0_cpp.cpp for a simple publisher/subscriber wiring:
auto session = transportzenoh::MakeZenohSession();
transportzenoh::ZenohPublisher pub(session, "roboflex/demo");
transportzenoh::ZenohSubscriber sub(session, "roboflex/demo");
sub.start();
examples/pub_sub_config_cpp.cpp shows a more explicit setup: setting mode/explicit endpoints, turning off multicast scouting, using express/priority publisher settings, and allowing any origin on the subscriber.
Python
Python bindings mirror the C++ API (ZenohSession, ZenohPublisher, ZenohSubscriber). Build via pip install . from the repo root after building the C++ library, like the other transport packages.
RPC / Request-Reply
For request-response workloads, use ZenohRequestClient and ZenohRequestServer instead of pub/sub. These are built on Zenoh query/queryable semantics.
auto session = transportzenoh::MakeZenohSession();
auto server = std::make_shared<transportzenoh::ZenohRequestServer>(
session,
"roboflex/rpc",
"ZenohRequestServer",
[](core::MessagePtr request) {
return request;
});
server->start();
transportzenoh::ZenohRequestClient client(
session,
"roboflex/rpc",
"ZenohRequestClient",
1000);
auto reply = client.call(request_message, 1000);
ZenohRequestClient is also a node: when it receives a message, it performs a blocking query and signals the first successful reply downstream.
Configuration knobs
ZenohSession: accepts an optionalconfig_json(JSON/JSON5 matching the Zenoh config schema), explicitmode(peer,client,router),connect_endpoints,listen_endpoints, andenable_multicast_scoutingtoggle.ZenohPublisher: opts forexpress(no batching),priority, andallowed_destination(seezc_locality_t).ZenohSubscriber: acceptsallowed_origin(alsozc_locality_t).ZenohRequestClient: accepts querytarget,express,priority,allowed_destination, and timeout.ZenohRequestServer: acceptsallowed_originand queryable completeness.- Key expressions follow Zenoh’s rules and support wildcards; see Zenoh key expressions.
System Dependencies
None beyond what the build pulls automatically: roboflex_core and zenoh-c are fetched via CMake FetchContent.
Metadata
Release files for roboflex.transport.zenoh 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| roboflex_transport_zenoh-0.1.4.tar.gz | 15.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| roboflex_transport_zenoh-0.1.4-cp311-cp311-macosx_15_0_arm64.whl | CPython 3.11 | CPython 3.11 | macOS 15.0+ ARM64 | Details |
Total release size: 4.9 MB
Release files / roboflex_transport_zenoh-0.1.4.tar.gz
| Download URL | roboflex_transport_zenoh-0.1.4.tar.gz |
|---|---|
| Size | 15.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
90bca3760d7b972b774480c25c3b4852a9b09756df2e1e09e476996d736161b6
|
|
BLAKE2b-256 checksum How to use checksums |
576c3087cfab2219cb6464d57d217b7f5f02ce0fa415d3ef2c85169797ce4115
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|
Release files / roboflex_transport_zenoh-0.1.4-cp311-cp311-macosx_15_0_arm64.whl
| Download URL | roboflex_transport_zenoh-0.1.4-cp311-cp311-macosx_15_0_arm64.whl |
|---|---|
| Size | 4.9 MB |
| Tags | CPython 3.11 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
53de7d144f9d863ef847306811952b06b93d9bbc2e1b9aee1361d51aad179709
|
|
BLAKE2b-256 checksum How to use checksums |
05a476c4873515db0f5725337260530ec143cf038eba83a3701a290fcbf7ebce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.5
|