wsdirector icon indicating copy to clipboard operation
wsdirector copied to clipboard

Elixir Phoenix support

Open palkan opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe.

It would be nice to have Phoenix Channels support out-of-the-box.

Describe the solution you'd like

Here is how we can communicate with Phoenix today:

---
- send:
    data:
      topic: "post:1"
      event: phx_join
      payload: {}
      ref: '1'
- receive:
    data:
      topic: "post:1"
      ref: '1'
      payload:
        status: ok
        response: {}
      event: phx_reply
- send:
    data:
      topic:"post:1"
      event: "submit_comment"
      payload:
        message:
          text: "That's nice"
      ref: '2'

With phoenix protocol, that could look like:

- client:
    protocol: "phoenix"
    actions:
       - join:
           topic: "posts:1" 
       - send:
           topic:  "posts:1"
           event: "submit_comment"
           payload:
             message:
               text: "That's even nicer"

Open questions

  • What about heartbeats? (Or we can ignore them)
  • Can we automatically add refs?

palkan avatar Jan 19 '22 17:01 palkan