Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions dimos/core/native_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ def start(self) -> None:

env = {**os.environ, **self.config.extra_env}

# Binary opens the same transport the coordinator resolved.
env["DIMOS_TRANSPORT"] = global_config.transport

# set Rust logging to match Python level
env["RUST_LOG"] = _PYTHON_TO_RUST_LEVELS.get(
os.environ.get("DIMOS_LOG_LEVEL", "").upper(), "info"
Expand Down Expand Up @@ -464,7 +467,7 @@ def _collect_topics(self) -> dict[str, str]:
transport = getattr(stream, "_transport", None)
if transport is None:
continue
topic = getattr(transport, "topic", None)
if topic is not None:
topics[name] = str(topic)
channel = getattr(transport, "channel", None)
if channel is not None:
topics[name] = channel
return topics
13 changes: 13 additions & 0 deletions dimos/core/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ class PubSubTransport(Transport[T]):
def __init__(self, topic: Any) -> None:
self.topic = topic

@property
def channel(self) -> str:
"""The channel string this transport publishes and subscribes on."""
return str(self.topic)

def __str__(self) -> str:
return (
colors.green(f"{self.__class__.__name__}(")
Expand Down Expand Up @@ -357,6 +362,10 @@ def __init__(self, topic: str | ZenohTopic, type: type | None = None, **kwargs:
self.zenoh = Zenoh(**kwargs)
self._start_lock = threading.RLock()

@property
def channel(self) -> str:
return cast("str", self.topic.key_expr)

def __reduce__(self) -> tuple[Any, ...]:
return (ZenohTransport, (self.topic,))

Expand Down Expand Up @@ -400,6 +409,10 @@ def __init__(self, topic: str | ZenohTopic, **kwargs: Any) -> None:
self.zenoh = PickleZenoh(**kwargs)
self._start_lock = threading.RLock()

@property
def channel(self) -> str:
return self._zenoh_topic.key_expr

def __reduce__(self) -> tuple[Any, ...]:
return (pZenohTransport, (self._zenoh_topic,))

Expand Down
Loading
Loading