I know that it’s possible to disconnect all sockets using id
of sockets on Phoenix,
but I want to disconnect sockets except current socket.
Is it possible?
I know that it’s possible to disconnect all sockets using id
of sockets on Phoenix,
but I want to disconnect sockets except current socket.
Is it possible?
How would you define which socket is the current socket? Can you maybe disconnect all and then reconnect once?
In this case,
Socket0 - Channel0, Channel1, Channel2
Socket1 - Channel3, Channel4, Channel5
I want to call a function like
MyApp.Endpoint.broadcast_from(self(), "user_socket:#{user_id}", "disconnect", %{})
on Channel1
that doesn’t disconnect channels from Socket0
; Channel0
, Channel1
, Channel2
.