Ask HN: What is the best way to implement a listener for web applications?
I can imagine a web application, e.g. php or ruby etc, that is linked to a typical database, e.g. mysql. The job queue is stored in the DB and another separate backend process polls this job queue - doing sql Selects Upon detecting a new job, the backend then starts a resource intensive process, e.g. launch a virtual server, uploads file, start crunching data.
I guess polling is fine if it is not so urgent or the db is small.
But for faster response, is there a good way to implement a listener? It simply accepts the job from the web application, stores a copy in the DB and starts the resource intensive part. The whole idea is to skip the polling of the database.
Java has some useful classes but what about other web languages? Or am I approaching this in the wrong way? What are your experience in implementing this? Thanks