Answer the question
In order to leave comments, you need to log in
Http queues in order of addition?
Hello!
I have a php project. The project calls an external service for certain data. There is a limit, for example, 1 request per second, otherwise a ban. Next, clients connect to my application and they need to provide this data. The server itself also makes requests to an external service on a schedule.
I think I need to implement this, the client connects via the http protocol and executes the post method with a data request. The server puts it in a queue, and in the meantime processes this queue in the order in which tasks enter it. The client continues to hang for this time (there will be asynchronous Ajax and no more than 2 seconds, taking into account all delays), the server processed it and returned the data. Removed it from the queue. In the same way, my cron server clings there and processes its tasks. Maybe there is a solution for this?
If not, I think to write a layer on nodejs, which would do this. It’s just that the node will have to be twisted for the first time, if there are examples of such implementations, it would also be nice to look ...
Answer the question
In order to leave comments, you need to log in
maybe try to wrap each request to the service through TOR? then they will not hang in an endless queue.
well, or through various free proxy lists
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question