我与运行在asyncio事件循环中的crossbar运行程序一起运行crossbar客户端。我想通过tkinter中的触发器调用RPC。有什么解决方案可以将它们组合在一起?
答案 0 :(得分:0)
您可以发出HTTP请求来调用您的RPC。 Crossbar HTTP Bridge Caller这里描述的所有内容。 快速摘要您需要做什么:
HTTP调用方配置在Web传输的路径上-这是 Crossbar配置的一部分:
{ "workers": [ { "type": "router", ... "transports": [ { "type": "web", ... "paths": { ... "call": { "type": "caller", "realm": "realm1", "role": "anonymous" } } } ] } ] }
例如,使用curl:
curl -H "Content-Type: application/json" \
-d '{"procedure": "com.example.add2", "args": [1, 2]}' \
http://127.0.0.1:8080/call