good_job icon indicating copy to clipboard operation
good_job copied to clipboard

Refactor the Notifier to be more of a generic Reactor

Open bensheldon opened this issue 2 years ago • 0 comments

#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 like connected? (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 named connected/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

bensheldon avatar Jan 25 '23 15:01 bensheldon