F
F
Fufilda2019-10-28 15:47:17
API
Fufilda, 2019-10-28 15:47:17

Will the VK API frequency limit work in such an implementation of requests?

VK api has a frequency limit, 20 requests per second.
There is an execute method with which you can combine several api calls into one. Up to 25 calls.
Let's say I have a game VK bot that needs to send responses to users quite often. Suppose there are 500 people online in the game (I don’t know if this is a lot or not), and every 2 seconds, he writes something to the bot. And in order for users to receive responses without delay, the server must send 250 messages per second.
Server: (NodeJs)
There is a certain database, let's say redis, we shove each user request there (we make a queue), if the user is unique, that is, he has not written anything yet and is not waiting for a response.
In another part of the server, there is an interval of 0.05 seconds.
He gets 25 people from the database, combines everything into one execute and sends it to VK. In total, 500 messages per second are obtained.
Question: is there any chance to catch blocking api method for a token? And how to avoid it?
On the one hand, I do not violate the frequency restrictions, on the other hand, there are suspicions that everything will not work according to plan.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail, 2019-10-28
@makarychev13

And look towards kue

P
Puma Thailand, 2019-10-28
@opium

And what's stopping you from stupidly checking? It's five seconds

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question