1

I run crossbar client with the runner of crossbar which run in the asyncio event loop. I want to call RPC by the trigger in tkinter. Is there any solution to combine them together?

Tom Zych
  • 13,329
  • 9
  • 36
  • 53
asurack
  • 11
  • 1

1 Answers1

0

You can make an HTTP request to call your RPC. Everything described here Crossbar HTTP Bridge Caller. Quick summary what you need to do:

  1. Make configuration:

The HTTP Caller is configured on a path of a Web transport - here is part of a Crossbar configuration:

{
   "workers": [
      {
         "type": "router",
         ...
         "transports": [
            {
               "type": "web",
               ...
               "paths": {
                  ...
                  "call": {
                     "type": "caller",
                     "realm": "realm1",
                     "role": "anonymous"
                  }
               }
            }
         ]
      }
   ]
}
  1. In your application make HTTP request

For example, using curl:

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