Linked Questions

Popular Questions

PHP - Queue incoming HTTP posts

Asked by At

I am writing an integration between several application in PHP. One application is outputting a webhook style HTTP post into a .php file on my webserver which then processes and sends the data to the other systems.

Presumably each POST will be executed asynchronously, which presents a few problems:

  1. The task takes time to complete, which MAY cause more threads to be running than the server can handle
  2. There are API call limits on the services I am trying to post the data too. I could well exceed them with a high volume of posts.

Is there a simple way to 'queue' HTTP requests? (I cant reject the POST really, if I do I won't get it again).

I've considered accepting the request and saving it to a database (quicker task) AND then have a CRON task iterating through records on the database. This would work but seems messy.

Related Questions