I am creating a real-time notification function in my application that will use Pusher to automatically notify the user when he receives a notification (which is generated by certain actions taken by the users that they follow).
I know how to set up an event and broadcast it, but I'm confused about the channels for broadcasting these notifications. The situation will be user A follows many other users, but also has many followers.
If user A posts new content, we can trigger an event that sends a notification to all of his subscribers that he just wrote something. The question here is, are we extending this channel to "user.A"? This means that every other user who follows user A will constantly subscribe to this channel along with the channels of every other user that they follow.
So, what is more efficient in order to dynamically broadcast over hundreds of different channels (each channel representing one of the followers of A), should each user automatically listen to the channels, possibly hundreds of different users?
Not sure which is more efficient. Thank!
source
share