Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Job Queue for Elixir. Clustered or Local. Straight BEAM. Optional Ecto. 💪🍈

License

NotificationsYou must be signed in to change notification settings

koudelka/honeydew

Repository files navigation

Build StatusHex pm

Honeydew ("Honey, do!") is a pluggable job queue and worker pool for Elixir, focused on at-least-once execution.

defmoduleMyWorkerdodefdo_a_thingdoIO.puts"doing a thing!"endend:ok=Honeydew.start_queue(:my_queue):ok=Honeydew.start_workers(:my_queue,MyWorker):do_a_thing|>Honeydew.async(:my_queue)# => "doing a thing!"

Isolation

  • Jobs are run in isolated one-time-use processes.
  • Optionally stores immutable state loaned to each worker (a database connection, for example).
  • Initialized Worker

Strong Job Custody

  • Jobs don't leave the queue until either they succeed, are explicitly abandoned or are moved to another queue.
  • Workers are issued only one job at a time, no batching.
  • If a worker crashes while processing a job, the job is reset and a "failure mode" (e.g. abandon, move, retry) is executed. (The default failure modeis to abandon the job.)
  • Job Lifecycle

Clusterable Components

  • Queues, workers and your enqueuing processes can exist anywhere in the BEAM cluster.
  • Global Queues

Plugability

Batteries Included

Easy API

The Ecto Queue is designed to painlessly turn your Ecto schema into a queue, using your repo as the backing store.

  • You don't need to explicitly enqueue jobs, that's handled for you (for example, sending a welcome email when a new User is inserted).
  • Eliminates the possibility of your database and work queue becoming out of sync
  • As the database is the queue, you don't need to run a separate queue node.
  • You get all of the high-availability, consistency and distribution semantics of your chosen database.

Check out the includedexample project, and its README.

Getting Started

In your mix.exs file:

defpdepsdo[{:honeydew,"~> 1.5.0"}]end

Deployment

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 isnot 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:

defapplicationdo[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.

defapplicationdo[included_applications:[:mnesia]]end

tl;dr

  • Check out theexamples.
  • Enqueue jobs withHoneydew.async/3, delay jobs by passingdelay_secs: <integer>.
  • Receive responses withHoneydew.yield/2.
  • Emit job progress withprogress/1
  • Queue/Worker status withHoneydew.status/1
  • Suspend and resume withHoneydew.suspend/1 andHoneydew.resume/1
  • List jobs withHoneydew.filter/2
  • Move jobs withHoneydew.move/2
  • Cancel jobs withHoneydew.cancel/2

README

The rest of the README is broken out into slightly more digestiblesections.

Also, check out the README files included with each of theexamples.

CHANGELOG

It's worth keeping abreast with theCHANGELOG

About

Job Queue for Elixir. Clustered or Local. Straight BEAM. Optional Ecto. 💪🍈

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp