使用0mq的uber极简消息总线
zebu的Python项目详细描述
ZEBU /ˈzeɪbuː/ - Bos primigenius indicus or Bos indicus or Bos taurus indicus sometimes known as indicine cattle or humped cattle, is a species or subspecies of domestic cattle originating in South Asia. Zebu are characterised by a fatty hump on their shoulders, a large dewlap, and sometimes drooping ears. They are well adapted to withstanding high temperatures, and are farmed throughout the tropical countries, both as pure zebu and as hybrids with taurine cattle, the other main type of domestic cattle. Zebu are used as draught oxen, dairy cattle, and beef cattle, as well as for byproducts such as hides and dung for fuel and manure. In 1999, researchers at Texas A&M University successfully cloned a zebu. https://en.wikipedia.org/wiki/Zebu
因为我是法国人,而Zebu依靠的是0毫克,所以我想这辆巴士的名字叫Zebus可能很酷。 当然,我忍不住想用牛来命名这个模块。
ZE服务
Zebu是一个超级极简总线,我实现它是为了好玩,结果证明是有用的(至少对我来说)。
要运行zebu,需要设置2个环境变量。 zebu_publish是发布服务器连接到的端点。 zebu_订阅订阅服务器连接到的终结点。
终结点的格式为transport://address,其中的传输很可能是ipc或tcp。
$zebu戋publish=ipc://publish zebu subscribe=ipc://subscribe python-m zebu
ZE模块
Zebu也是一个模块,您可以导入该模块以使用精心编制的帮助程序定义…
订户
>>> from zebu import subscribe >>> messages = subscribes('a/topic', 'another/topic') >>> for message in messages: ... # do something with message
出版商
>>> from zebu import publisher >>> publish = publisher() >>> publish('a/topic', 'a message on that topic')