good_job
good_job copied to clipboard
Refactor the Notifier to be more of a generic Reactor
#810 makes me see there's some tech-debt in the Notifier
because it's more of a reactor now, but still has a lot of the terminology of when it simply did LISTEN.
- the
listening?
predicate should be more likeconnected?
(or have both exist) to separate between "the background thread is connected to the database" and "this is actually doing a LISTEN" - The
listen
/unlisten
callbacks should be namedconnected
/disconnected
- The while-loop+
wait_for_notify
should be more clearly a "tick" of the reactor. - A good design here would mean that the LISTEN functionality could be extracted into a module that registered callbacks, like
GoodJob::Notifier::ProcessRegistration
Also could be connected to #796