vehicle_common.runtime.peer_connections#

Attributes#

Classes#

Functions#

normalize_vehicle_name(→ str)

normalize_peer_vehicle_names(→ tuple[str, ...])

declared_remote_peer_names(→ tuple[str, ...])

relevant_connection_status(→ dict[str, bool])

Module Contents#

HEARTBEAT_TOPIC_SUFFIX = 'mode_manager/heartbeat'#
normalize_vehicle_name(vehicle_name: str | None) str#
normalize_peer_vehicle_names(peer_vehicle_names: tuple[str, ...] | list[str] | set[str] | None) tuple[str, ...]#
declared_remote_peer_names(peer_vehicle_names: object, runtime_vehicle_name: str) tuple[str, ...]#
relevant_connection_status(connection_status: Mapping[str, bool], *, peer_vehicle_names: collections.abc.Iterable[str]) dict[str, bool]#
class PeerConnectionTracker(*, runtime_vehicle_name: str = '', peer_heartbeat_hz: float = 10.0, peer_stale_timeout_s: float = 0.5, now_seconds: Callable[[], float], on_connection_change: Callable[[str], None] | Callable[..., None], raw_create_publisher: Callable[..., object], raw_create_subscription: Callable[..., object], raw_destroy_publisher: Callable[[object], bool | None], raw_destroy_subscription: Callable[[object], bool | None], raw_create_timer: Callable[..., object], raw_destroy_timer: Callable[[object], bool | None] | None = None)#
_runtime_vehicle_name = ''#
peer_heartbeat_hz#
peer_stale_timeout_s#
_now_seconds#
_on_connection_change#
_raw_create_publisher#
_raw_create_subscription#
_raw_destroy_publisher#
_raw_destroy_subscription#
_raw_create_timer#
_raw_destroy_timer = None#
_heartbeat_publisher = None#
_heartbeat_timer = None#
_heartbeat_subscriptions: dict[str, object]#
_connected: dict[str, bool]#
_last_seen: dict[str, float | None]#
_peer_names: tuple[str, ...] = ()#
property peer_names: tuple[str, ...]#
status() dict[str, bool]#
_heartbeat_topic_for(vehicle_name: str) str#
configure(peer_vehicle_names: tuple[str, ...] | list[str] | set[str]) None#
_peer_heartbeat_callback(peer_name: str) None#
_peer_timer_callback() None#
close() None#