简体   繁体   English

从python守护程序发布到crossbar.io

[英]Publishing to crossbar.io from python daemon

I would like to use crossbar.io to display real-time stats on the web about a long-running python daemon. 我想使用crossbar.io在Web上显示有关长时间运行的python守护程序的实时统计信息。 The displaying part works fine using AutobahnJS, but I struggle with the part that posts stats to crossbar.io. 使用AutobahnJS,显示部分可以正常工作,但是我很难将部分统计信息发布到crossbar.io。 All the example code I read runs on twisted or asyncio, and my daemon doesn't (and won't). 我阅读的所有示例代码都在twist或asyncio上运行,而我的守护进程则不会(也不会)。 For pure WebSockets, there's the websocket_client package which does exactly what I would like to do, just not on WAMP. 对于纯WebSocket,有一个websocket_client软件包可以完全满足我的要求,只是不在WAMP上。 Is there a similar library, or am I missing something in the docs? 是否有类似的库,或者我在文档中缺少什么?

I'm using crossbar.io over pure WebSockets because I like the PubSub abstraction. 我在纯WebSocket上使用crossbar.io,因为我喜欢PubSub抽象。 I know I can re-implement it in WebSockets without a lot of additional work, but that's something I'd like to avoid. 我知道我可以在WebSockets中重新实现它,而无需进行很多其他工作,但这是我要避免的事情。

I finally found a similar question, the solution is to use crossbar's HTTP Publisher service . 我终于找到了一个类似的问题,解决方案是使用crossbar的HTTP Publisher服务 There's also the crossbarconnect package which conveniently wraps all the necessary HTTP action. 还有crossbarconnect包,可以方便地包装所有必需的HTTP操作。 Sweet and short :-) 甜而简短:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM