Can autobahn.twisted.wamp.Application do pub/sub?
问题 I would like to use some pub/sub features along with rpc from autobahn.twisted.wamp.Application I'd prefer not to make a ApplicationSession class if I can get by without doing so. Can registered rpc methods cause client subscriptions and publish? If they can, please show me how. 回答1: Yes, sure: def onEvent(msg): print("got event: {}".format(msg)) @app.register('com.example.triggersubscribe') def triggerSubscribe(): yield app.session.subscribe(onEvent, 'com.example.topic1') When