Phoenix channels and their relation to sockets

I need advice on elixir / phoenix channels. I have an application related to changes in the venue of the event, and to reduce the amount of data sent to each client, I want each client to subscribe to the places that he needs.

With this in mind, I was thinking about going down the channel for "VenueChanges / *", and each client subscribes to the channel several times with each identifier of the place that it deals with, i.e. "VenueChanges / 1", VenueChanges / 2 "etc.

Locations that care about the customer will often change, which will mean many connections and channels.

My question is that the overhead is for the client to connect to the channel several times. Do I correctly assume that only one socket will be opened, and not a new socket for each of the connected channels?

Also, there are tips for managing a permanent connection and output channels from the client? Any other advice whatsoever? If this is a bad idea, then which alternatives are better?

+4
source share
1 answer

Regarding the question of socket, you are right that you will have only one socket per client (several channels are multiplexed on one socket).

/, Chris McCord Phoenix Channels vs Rails Action Cable :

Phoenix , ,

, .

, , / ( "", ), 55 000 :

, Phoenix ​​ 50 200 .

0

Source: https://habr.com/ru/post/1625766/


All Articles