oban v2.12.0 Release Notes

Release Date: 2022-04-19 // about 2 years ago
  • โœจ Enhancements

    • ๐Ÿ”ง [Oban] Replace queue, plugin, and peer test configuration with a single :testing option. Now configuring Oban for testing only requires one change, setting the test mode to either :inline or :manual.

      • :inlineโ€”jobs execute immediately within the calling process and without touching the database. This mode is simple and may not be suitable for apps with complex jobs.
      • :manualโ€”jobs are inserted into the database where they can be verified and executed when desired. This mode is more advanced and trades simplicity for flexibility.
    • โœ… [Testing] Add with_testing_mode/2 to temporarily change testing modes within the context of a function.

    Once the application starts in a particular testing mode it can't be changed. That's inconvenient if you're running in :inline mode and don't want a particular job to execute inline.

    • ๐Ÿ”ง [Config] Add validate/1 to aid in testing dynamic Oban configuration.

    • ๐Ÿ”Œ [Config] Validate full plugin and queue options on init, without the need to start plugins or queues.

    • [Peers.Global] Add an alternate :global powered peer module.

    • ๐Ÿ”Œ [Plugin] A new Oban.Plugin behaviour formalizes starting and validating plugins. The behaviour is implemented by all plugins, and is the foundation of enhanced config validation.

    • ๐Ÿ”Œ [Plugin] Emit [:oban, :plugin, :init] event on init from every plugin.

    ๐Ÿ› Bug Fixes

    • ๐Ÿ‘ท [Executor ] Skip timeout check with an unknown worker

    When the worker can't be resolved we don't need to check the timeout. Doing so prevents returning a helpful "unknown worker" message, and instead causes a function error for nil.timeout/1.

    • โœ… [Testing] Include log and prefix in generated conf for perform_job.

    The opts, and subsequent conf, built for perform_job didn't include the prefix or log options. That prevented functions that depend on a job's conf within perform/1 from running with the correct options.

    • ๐Ÿ”ง [Drainer] Retain the currently configured engine while draining a queue.

    • [Watchman] Skip pausing queues when shutdown is immediate. This prevents queue's from interacting with the database during short test runs.

    ๐Ÿ‘€ For changes prior to v2.12 see the v2.11 docs.

    ๐Ÿ“„ [opc]: https://getoban.pro/docs/pro/changelog.html ๐ŸŒ [owc]: https://getoban.pro/docs/web/changelog.html