remotivelabs.broker.restbus
class
Restbus:
async def
close(self, *namespace: str) -> None:
Removes all configured signals and stops the Restbus on the specified namespace.
Arguments:
- *namespace: One or more namespaces to close
Adds one or more frames to the Restbus with optional start flag.
Arguments:
- *frames: One or more tuples, each containing namespace and list of frame configurations which should be added to the restbus
- start: If True, starts the frames after adding. Defaults to False.
Note: The start flag affects all frames running on the namespace, even if they are added since before.
async def
start(self, *namespace: str):
Starts Restbus signal publishing for the specified namespaces.
Arguments:
- *namespace: One or more namespaces to start
async def
stop(self, *namespace: str):
Stops Restbus signal publishing for the specified namespaces.
Arguments:
- *namespace: One or more namespaces to stop. A stopped restbus can be started again.
async def
remove(self, *frames: tuple[str, list[str]]):
Removes specific frames from the Restbus.
Arguments:
- *frames: One or more tuples, each containing namespace and list of frame names to remove from the restbus
Updates the configured signals on the Restbus with new values.
Arguments:
- *signals: One or more tuples, each containing namespace and list of signal configurations to apply to the restbus
@dataclass
class
RestbusSignalConfig:
This class defines how a specific signal should behave when emitted by Restbus. A signal can have:
Attributes:
- name: The name of the signal
- loop: Values emitted in order after the initial sequence
- initial: Optional values emitted once before the loop starts
RestbusSignalConfig( name: str, loop: Sequence[Union[int, float, bytes, str]], initial: Sequence[Union[int, float, bytes, str]] = <factory>)
Create a SignalConfig with a constant value.
Arguments:
- name: Name of the signal
- value: Value to set in Restbus
@dataclass
class
RestbusFrameConfig:
Configuration for a frame in the Restbus.
Attributes:
- name: The name of the frame to configure.
- cycle_time: Optional cycle time override for the frame. If None, the default from the broker's database is used.