Oban.Plugins.Gossip (Oban v2.10.1) View Source

The Gossip plugin uses PubSub to periodically exchange queue state information between all interested nodes. This allows Oban instances to broadcast state information regardless of which engine they are using, and without storing anything in the database.

Gossip enables real-time updates across an entire cluster, and is essential to the operation of UIs like Oban Web.

The Gossip plugin entirely replaced heartbeats and the legacy oban_beats table.

Using the Plugin

The following example demonstrates using the plugin without any configuration, which will broadcast the state of each local queue every 1 second:

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

Override the default options to broadcast every 5 seconds:

config :my_app, Oban,
  plugins: [{Oban.Plugins.Gossip, interval: :timer.seconds(5)}],
  ...

Options

  • :interval — the number of milliseconds between gossip broadcasts

Instrumenting with Telemetry

The Oban.Plugins.Gossip plugin adds the following metadata to the [:oban, :plugin, :stop] event:

  • :gossip_count - the number of queues that had activity broadcasted

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Link to this section Types

Specs

option() ::
  {:conf, Oban.Config.t()}
  | {:name, GenServer.name()}
  | {:interval, pos_integer()}

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.