-
Notifications
You must be signed in to change notification settings - Fork 195
Description
In working on #340, we noted that Que has not just one, but two PostgreSQL notify triggers:
-
que_job_notifytrigger
que_listener_#{locker_pid}notification channel
job_availablenotification message
Source -
que_state_notifytrigger
que_statenotification channel
job_changenotification message
Source
que_job_notify is used for the job_available notification message, telling a random locker (worker) that there's a new job ready to pick up. This is crucial for Que's listen/notify system (which sits alongside the polling system).
que_state_notify on the other hand, sends a message when a job transitions to another state (expired, finished, errored, scheduled, ready). Whilst this is interesting functionality, it does not appear to be, or have ever been, used for anything:
- Nothing
LISTENs to theque_statenotification channel - The commit messages on the commits which added
que_state_notifyfunctionality offer no insight into why it was added - see the commits around 6729e65
Given that nothing is subscribing to the messages produced, que_state_notify appears to just be wasting database resources in calculating and producing these messages (related: #299).
Perhaps this was part of a feature that was never completed? @chanks, any chance you recall your intention with this?
I can't see a good reason to keep this functionality, so I'm thinking that unless we hear otherwise from anyone, we'll deprecate it in the next release, and remove it at some point after that.