sorentwo/oban

Replace pg_notify insert trigger with in-app notifications

sorentwo opened this issue · 0 comments

Is your feature request related to a problem? Please describe.

There are two aspects to this change:

  1. Switching to a notifier besides Postgres removes immediate job availability notifications. That increases the typical lag between job insertion and execution from almost immediate to up to 1s.
  2. Notification triggers still fire after switching from the Postgres notifier, even though unused. That adds unnecessary overhead to insert operations and requires a migration to clear out.

Describe the Solution You'd Like

Remove the trigger function and replace it with an optional notification triggered after insert_job or insert_all_jobs calls.

Describe Alternatives You've Considered

Document that people should remove the trigger after switching notifiers and that they'll have added latency between inserting and executing.