- Return {:error, reason} tuple for Honeydew.start_queue/2 + start_workers/3. Thanks @hauleth!
- Job results are now correctly passed to Success Modes
- Support for compound primary keys in ecto tables.
- No longer assumes that ecto tables have a single primary key named
id
- Don't ignore mnesia table options provided by the user. Thanks @X4lldux!
- Job execution filtering for Ecto Poll Queue with
:run_if
option, taking a boolean SQL fragment - Adding
:timeout
option toHoneydew.status/2
-
Delayed Jobs
You may now pass the
:delay_secs
argument toasync/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, 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 is2
.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
-
[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
-
[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.
- Ecto 3 support
- Adding table prefixes to Ecto Poll Queue (thanks @jfornoff!)
- Honeydew crash log statements now include the following metadata
:honeydew_crash_reason
and:honeydew_job
. These metadata entries can be used for building a LoggerBackend that could forward failures to an error logger integration like Honeybadger or Bugsnag.
- Don't restart workers when linked process terminates normally
- Catch thrown signals on user's init/1
- Gracefully restart workers when an unhandled message is received.
- Catch thrown signals from user's job code
- Stop ignoring
init_retry_secs
worker option - Fixed
Honeydew.worker_opts
typespecs. - Fixed
Honeydew.start_workers
specs.
Honeydew now supervises your queues and workers for you, you no longer need to add them to your supervision trees.
Honeydew.queue_spec/2
andHoneydew.worker_spec/3
are now hard deprecated in favor ofHoneydew.start_queue/2
andHoneydew.start_workers/3
- Rapidly failing jobs no longer have a chance to take down the worker supervisor.
Honeydew.queues/0
andHoneydew.workers/0
to list queues and workers running on the local node.Honeydew.stop_queue/1
andHoneydew.stop_workers/1
to stop local queues and workers- Workers can now use the
failed_init/0
callback in combination withHoneydew.reinitialize_worker
to re-init workers if their init fails. - Many other things I'm forgetting...
- Updated
Honeydew.cancel/1
to return{:error, :not_found}
instead ofnil
when a job is not found on the queue. This makes it simpler to pattern match against error conditions, since the other condition is{:error, :in_progress}
. - Changed
Honeydew.Queue.cancel/2
callback to return{:error, :not_found}
instead ofnil
when a job isn't found. This makes the return types the same asHoneydew.cancel/1
.
- Fixed issue where new workers would process jobs from suspended queues (#35)
- Docs and typespecs for the following functions
Honeydew.async/3
Honeydew.filter/2
Honeydew.resume/1
Honeydew.suspend/1
Honeydew.yield/2
- Removed
use Honeydew.Queue
in favor of@behaviour Honeydew.Queue
callbacks
- Added Honeydew.worker behaviour
- Relaxed typespec for
Honeydew.worker_spec/3
module_and_args
param (#27) - New docs for
Honeydew.FailureMode
Honeydew.FailureMode.Abandon
Honeydew.FailureMode.Move
Honeydew.FailureMode.Retry
Honeydew.Queue.ErlangQueue
Honeydew.Queue.Mnesia
- Validate arguments for success and failure modes