我如何将纵横制客户端(python3,asyncio)与tkinter集成

时间:2018-07-18 03:50:03

标签: python tkinter integrate crossbar

我与运行在asyncio事件循环中的crossbar运行程序一起运行crossbar客户端。我想通过tkinter中的触发器调用RPC。有什么解决方案可以将它们组合在一起?

1 个答案:

答案 0 :(得分:0)

您可以发出HTTP请求来调用您的RPC。 Crossbar HTTP Bridge Caller这里描述的所有内容。 快速摘要您需要做什么:

  1. 进行配置:
  

HTTP调用方配置在Web传输的路径上-这是   Crossbar配置的一部分:

{
   "workers": [
      {
         "type": "router",
         ...
         "transports": [
            {
               "type": "web",
               ...
               "paths": {
                  ...
                  "call": {
                     "type": "caller",
                     "realm": "realm1",
                     "role": "anonymous"
                  }
               }
            }
         ]
      }
   ]
}
  1. 在您的应用程序中发出HTTP请求

例如,使用curl:

curl -H "Content-Type: application/json" \
    -d '{"procedure": "com.example.add2", "args": [1, 2]}' \
    http://127.0.0.1:8080/call