honeydew v1.4.0 Release Notes

Release Date: 2019-04-08 // about 5 years ago
  • ✨ Enhancements

    • 👷 Delayed Jobs

    You may now pass the :delay_secs argument to async/3 to execute a job when the given number of seconds has passed.

    See the Delayed Job Example

    Queue Support: - Mnesia

    Fully supported, uses the system's montonic clock. It's recommended to use [Multi Time Warp Mode](http://erlang.org/doc/apps/erts/time_correction.html#multi-time-warp-mode), to prevent the monotonic clock from freezing for extended periods during a time correction, with `--erl "+C multi_time_warp"`.
    - `EctoPollQueue`
    
    Unsupported, since the Ecto queue doesn't use `async/3`. However, delayed retries are supported.
    
    It's technically feasible to delay Ecto jobs. As Honeydew wants nothing to do with your model's insertion transaction (to limit its impact on your application), its job ordering is handled by default values in the migration. In order to delay Ecto jobs, you'll need to manually add a number of milliseconds to the `DEFAULT` value of honeydew's lock field in your insertion transaction.
    
    - `ErlangQueue`
    
    Unsupported, pending a move to a priority queue. See "Breaking Changes" below to use delayed jobs with an in-memory queue.
    
    • Exponential Retry (backoff)

    Honeydew now supports exponential retries with the ExponentialRetry failure mode. You can optionally set the exponential base with the :base option, the default is 2.

    See the Exponential Retry example and docs

    • Customizable Retry Strategies

    The Retry failure mode is now far more customizable, you can provide your own function to determine if, and when, you want to retry the job (by returning either {:cont, state, delay_secs} or :halt).

    See the Exponential Retry Implementation and docs

    💥 Breaking Changes

    • [Mnesia] The schema for the Mnesia queue has been simplified to allow for new features and future backward compatibility. Unfortuntaely, this change itself isn't backward compatible. You'll need to drain your queues and delete your on-disk mnesia schema files (Mnesia.*), if you're using :on_disc, before upgrading and restarting your queues.

    • [Mnesia] The arguments for the Mnesia queue have been simplified, you no longer need to explicitly provide a separate list of nodes, simply provide the standard mnesia persistence arguments: :ram_copies, :disc_copies and :disc_only_copies.

    See the Mnesia Example

    • 0️⃣ [ErlangQueue] The in-memory ErlangQueue is no longer the default queue, since it doesn't currently support delayed jobs. If you still want to use it, you'll need to explicitly ask for it when starting your queue, with the :queue argument. Instead, the default queue is now an Mnesia queue using :ram_copies and the :ets access mode.