Skip to content

v1.1.7

Compare
Choose a tag to compare
@Undertone0809 Undertone0809 released this 09 Jan 18:22
· 28 commits to main since this release
920f646

upgrade

You can use the following sentence to upgrade the version.

pip install --upgrade broadcast-service

feat

  1. add decorator, optimize syntactic expression #5
  • You can use the following sentences to subscribe topic
@broadcast_service.on_listen(['topic1'])
def handle_all_msg():
    # your code

@broadcast_service.on_listen(['topic1','topic2'])
def handle_all_msg():
    # your code

@broadcast_service.on_listen()
def handle_all_msg(*args, **kwargs):
    # your code
  • Add some equals function name
# send topic msg
broadcast_service.subscribe('my_topic', handle_msg)
broadcast_service.listen('my_topic', handle_msg)
broadcast_service.on('my_topic', handle_msg)

# listen topic msg
broadcast_service.broadcast('my_topic', info)
broadcast_service.publish('my_topic', info)
broadcast_service.emit('my_topic', info)

test

  • optimize tests and add some demo #5