Pubnub - remove a large number of channels from multiple channel groups

I use a template in which each user has his own group of channels, and when he connects to the chat, the chat is added to his group on the backend. This approach allows the user to connect to multiple channels simultaneously.
I also have a scheduler that from time to time does batch deletion of database items that the chats are connected to, so I need to remove related channels from user channel groups.

Questions:

  • Do I need to do this to prevent groups from getting into 2k? Or inactive channels will be automatically destroyed?

  • Channel group maintenance - if I have 2000 chats, ~ 50 users in each:

    a. How can I efficiently clear user channel groups?

    b. Can I somehow destroy a channel or remove it from all groups at once, so I will need to make 2,000 calls or do I need to delete a channel to a group of user channels, and so I will have to make 100,000 calls at pubnubonce?

+4
source share
1 answer

PubNub Channel Groups

Channel Group Maintenance

  • You need to track the number of channels in the channel group. You can get a list of channels in channel groups using the channel channels API, and then make a count / size of the returned array.
  • , ( ) API . , , .
  • - , , , PubNub SDK . , .
  • .
  • , . , 10K .
  • manage, manage , , , read, .

...

, . , , , . PubNub . , , . ( ) , , , :)

Offline Users

, - , , , . API history, .

+2

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


All Articles