What is the best way to listen to a lot of channels and events using Pusher -
i have 40 categories , each category has 10-100 subcategories. default, user listens categories , subcategories. want give each user ablity select unbind whole category or specific subcategory. so, right have each category channel, , each subcategory event.
now, have each user bound 2000-3000 events, , know wrong, right way let user filter between 3000 events? okay bind many events?
it's important remember when subscribe channel events channel sent client (pusher - clients), if have not bound event.
with information above in mind, i'd recommend using channels filter data. overhead when subscribing channels isn't great. example, subscribing 40 channels wouldn't represent significant resource usage. need consider if channels public (anybody can subscribe) or private each call pusher.subscribe( 'private-channel-x' );
result in authentication request server. there multi-auth plugin allows batching of authentication requests take place.
one solution have each user subscribe own notification channel , send them events things interested in on single channel. can use multi publish functionality this, lets send same event on many channels. may useful if wish send same event multiple users. however, solution may not elegant information architecture point of view.
the best solution here depends on application. above have facts let make efficient choice.
Comments
Post a Comment