View Source Oban.Plugins.Repeater (Oban v2.12.1)

Repeatedly send inserted messages to all registered producers to simulate polling.

⚠️ This plugin is a last resort and only necessary if you're running Oban in an environment where neither Postgres nor PG notifications work. That situation should be rare, and limited to the following conditions:

  1. Running with a database connection pooler, i.e. pg_bouncer, in transaction mode
  2. Running without clustering, .i.e. distributed Erlang

If both of those criteria apply and PubSub notifications won't work at all, then the Repeater will force local queues to poll for jobs.

Note that the Repeater plugin won't enable other PubSub based functionality like pausing, scaling, starting, and stopping queues.

using-the-plugin

Using the Plugin

Tell all local, idle queues to poll for jobs every one second:

config :my_app, Oban,
  plugins: [Oban.Plugins.Repeater],
  ...

Override the default interval and poll every 30 seconds:

config :my_app, Oban,
  plugins: [{Oban.Plugins.Repeater, interval: :timer.seconds(30)],
  ...

options

Options

  • :interval — the number of milliseconds between notifications. The default is 1_000ms.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Link to this section Types

@type option() :: Oban.Plugin.option() | {:interval, pos_integer()}

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.