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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了我如何将crossbar客户端(python3,asyncio)与tkinter集成相关的知识,希望对你有一定的参考价值。

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

答案

您可以发出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

以上是关于我如何将crossbar客户端(python3,asyncio)与tkinter集成的主要内容,如果未能解决你的问题,请参考以下文章

如何为动态聊天室配置 Autobahn(crossbar.io)?

am5728 中断的使用

axi_crossbar IP使用说明

将tcp客户端套接字类从python2转换为python3

如何将ethiopic字体添加到python3?

am5728 中断的使用