broadcast-service is a lightweight python broadcast library. You can easily construct a broadcast pattern through this library.
pip install constellat-broadcast-service
There is a easy demo to show how to use broadcast-service.
from broadcast_service import broadcast_service
def handle_msg(params):
print(params)
if __name__ == '__main__':
info = 'This is very important msg'
# listen topic
broadcast_service.listen('Test', handle_msg)
# publish broadcast
broadcast_service.broadcast('Test', info)
# 打包项目
python setup.py sdist
# 上传包
twine upload dist/*
twine upload dist/constellat_broadcast_service.tar.gz