Function py_msgbus_subscribe

Source
pub fn py_msgbus_subscribe(
    topic: &str,
    handler: PythonMessageHandler,
    priority: Option<u8>,
)
Expand description

Subscribes the given handler to the topic.

The priority for the subscription determines the ordering of handlers receiving messages being processed, higher priority handlers will receive messages before lower priority handlers.

Safety: Priority should be between 0 and 255

Updates topic handler if already exists.

§Warnings

Assigning priority handling is an advanced feature which shouldn’t normally be needed by most users. Only assign a higher priority to the subscription if you are certain of what you’re doing. If an inappropriate priority is assigned then the handler may receive messages before core system components have been able to process necessary calculations and produce potential side effects for logically sound behavior.