Job Queue for Elixir. Clustered or Local. Straight BEAM. Optional Ecto. 💪🍈
Honeydew ("Honey, do!") is a pluggable job queue and worker pool for Elixir, focused on at-least-once execution.
defmodule MyWorker do
def do_a_thing do
IO.puts "doing a thing!"
end
end
:ok = Honeydew.start_queue(:my_queue)
:ok = Honeydew.start_workers(:my_queue, MyWorker)
:do_a_thing |> Honeydew.async(:my_queue)
# => "doing a thing!"
Isolation
Strong Job Custody
Clusterable Components
Plugability
Batteries Included
Easy API
async/3
and you can receive replies with yield/2
, somewhat like Task.The Ecto Queue is designed to painlessly turn your Ecto schema into a queue, using your repo as the backing store.
Check out the included example project, and its README.
In your mix.exs file:
defp deps do
[{:honeydew, "~> 1.5.0"}]
end
If you're using the Mnesia queue (the default), you'll need tell your release system to include the :mnesia
application, and you'll have to decide how you're going to create your on-disk schema files, which needs to be done while mnesia is not running.
If you use mnesia outside of Honeydew, you'll want to use the :extra_applications
configuration key in your mix.exs file, as well as manually creating your mnesia schema with :mnesia.create_schema(nodes)
in an iex session in production:
def application do
[
extra_applications: [:mnesia]
]
end
Otherwise, if Honeydew is the only user of mnesia, you can let Honeydew manage it by simply using the :included_applications
key instead.
def application do
[
included_applications: [:mnesia]
]
end
Honeydew.async/3
, delay jobs by passing delay_secs: <integer>
.Honeydew.yield/2
.progress/1
Honeydew.status/1
Honeydew.suspend/1
and Honeydew.resume/1
Honeydew.filter/2
Honeydew.move/2
Honeydew.cancel/2
The rest of the README is broken out into slightly more digestible sections.
Also, check out the README files included with each of the examples.
It's worth keeping abreast with the CHANGELOG