oban v2.6.0 Release Notes

Release Date: 2021-04-02 // over 1 year ago
  • โฌ†๏ธ ๐ŸŒŸ Web and Pro users should check the [v2.6 upgrade guide][v26ug] for a complete walkthrough.

    ๐Ÿ”Œ Pluggable Queue Engines

    Queue producers now use an "engine" callback module to manage demand and work โœจ with the database. The engine provides a clean way to expand and enhance the functionality of queue producers without modifying the solid foundation of queue supervision trees. Engines make enhanced functionality such as global concurrency, local rate limiting and global rate limiting possible!

    The BasicEngine is the default, and it retains the exact functionality of previous Oban versions. To specify the engine explicitly, or swap in an ๐Ÿ”ง alternate engine, set it in your configuration:

    config :my_app, Oban,
      engine: Oban.Queue.BasicEngine,
      ...
    

    โฌ†๏ธ See the [v2.6 upgrade guide][v26ug] for instructions on swapping in an alternate engine.

    Recursive Queue Draining

    The ever-handy Oban.drain_queue/1,2 function gained a new with_recursion ๐Ÿ‘ท option, which makes it possible to test jobs that insert more jobs when they execute. When with_recursion is enabled the queue will keep executing until no โฑ jobs are available. It even composes with with_scheduled!

    โœ… In practice, this is especially useful for testing dependent workflows.

    ๐Ÿ”Œ Gossip Plugin for Queue Monitoring

    ๐Ÿ”Œ The new gossip plugin uses PubSub to efficiently 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.

    โฌ†๏ธ See the [v2.6 upgrade guide][v26ug] for details on switching to the gossip ๐Ÿ”Œ plugin.

    โž• Added

    • ๐Ÿ‘ท [Oban.Job] Inject the current conf into the jobs struct as virtual field, making the complete conf available within perform/1.

    • [Oban.Notifier] Add unlisten/2, used to stop a process from receiving notifications for one or more channels.

    ๐Ÿ”„ Changed

    • [Oban.Telemetry] Stop emitting circuit events for queue producers. As producers no longer poll, the circuit breaker masked real errors more than it guarded against sporatic issues.

    • [Oban.Telemetry] Delay [:oban, :supervisor, :init] event until the complete supervision tree finishes initialization.

    • [Oban.Migration] Stop creating an oban_beats table entirely.

    ๐Ÿ›  Fixed

    • โฑ [Oban.Plugins.Cron] Prevent schedule overflow right before midnight