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

问题描述 投票:1回答:1

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

python tkinter integrate crossbar
1个回答
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
© www.soinside.com 2019 - 2024. All rights reserved.