将autobahn带入您的同步应用!
项目描述
Autobahn~Sync
Autobahn与crochet集成,为同步应用提供WAMP。
最初基于Sam & Max(警告:法语,内有成人内容和无与伦比之处!)的工作。
快速示例
from time import sleep
from autobahn_sync import publish, call, register, subscribe, run
@register('com.app.shout')
def shout(msg):
return msg.upper()
@subscribe('com.app.idea')
def on_thought(msg):
print("I've just had a new idea: %s" % msg)
run()
while True:
print(call('com.app.shout', 'Autobahn is cool !'))
publish('com.app.idea', 'Use autobahn everywhere !')
sleep(1)
此代码将连接到监听ws://127.0.0.1:8080/ws的crossbar路由器(在尝试此片段之前,请记住启动它!)并在域realm1中注册自己。
有关更多用例,请参阅示例
附加功能
请参阅扩展文件夹中的Flask扩展;)
现在获取
pip install -U autobahn-sync
许可证
MIT许可。有关更多详细信息,请参阅捆绑的LICENSE文件。
项目详情
关闭
autobahn-sync-0.3.2.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 1b9aebab11680005fde3c0e9d0cf5d24929f0b01336f06b866c1cea0408bf6d0 |
|
MD5 | c12e8ebbeca71cc4849fdead8c056e2d |
|
BLAKE2b-256 | 1857116421184bb019190d649591f221303f64002273e359d06ad332ea06c0a7 |