import sys_bus


def sub_cb(topic, msg):
    """
    订阅函数
    :param topic: 订阅的topic
    :param msg: 来自topic的消息
    :return:
    """
    print("sub_cb === {}".format(topic, msg))


# 订阅topic
sys_bus.subscribe("test", sub_cb)

# 发布消息到topic中
sys_bus.publish("test", "this is one sys_bus")
