Use PostgreSQL notifications for queue events

Hydra-queue-runner now no longer polls the queue periodically, but instead sleeps until it receives a notification from PostgreSQL about a change to the queue (build added, build cancelled or build restarted).

Also, for the "build added" case, we now only check for builds with an ID greater than the previous greatest ID. This is much more efficient if the queue is large.

Created by  Eelco Dolstra  on June 11, 2015
ATJ54SPXPE2IIFRERUOBFF42HBSEADP4QOI743ZBUNBQX3PYKRXQC
Change contents