The current situation is: the Android app sends a registration request to the server built with nodejs, and nodejs is responsible for calling the relevant API to register with Huanxin.
However, Huanxin has limited flow for the API, so it wants to do batch processing, such as The api for batch registration is called once per second.
(Instructions for limiting the current limit of the environment signal interface: http://docs.easemob.com/im/45...
The problem now is that first of all, I don’t know much about the cache request. Is there a better way? Secondly, for each request sent by the Android app, a message must be returned to inform the success or failure. If it is cached for batch processing, how to return a message to the app?
Use queues and asynchronous callbacks to reply to requests. Each request has a callback function. All registration requests are added to the queue. This queue is processed once per second. After processing a request, the callback is executed and the registration result is passed in as a parameter.