How do I find out who is connected to ActionCable?

前端 未结 2 1993
囚心锁ツ
囚心锁ツ 2020-12-10 02:41

I have seen ActionCable.server.open_connections_statistics, ActionCable.server.connections.length, ActionCable.server.connections.map(&:s

2条回答
  •  时光说笑
    2020-12-10 03:26

    If using redis you can see all the pubsub channels.

    [2] pry(main)> Redis.new.pubsub("channels", "action_cable/*")
    [
        [0] "action_cable/Z2lkOi8vbWFvY290LXByb2plL3QvUmVzcG9uXGVyLzEx",
        [1] "action_cable/Z2lkOi8vbWFvY290LXByb2plL3QvUmVzcG9uXGVyLzI"
    ]
    

    This will show all websocket connections for all the Puma workers together. And if you have multiple servers it will probably show those here too.

提交回复
热议问题