Giter VIP home page Giter VIP logo

honeydew's Introduction

Honeydew ๐Ÿ’ช๐Ÿป๐Ÿˆ

Build Status Hex pm

Honeydew ("Honey, do!") is a pluggable job queue and worker pool for Elixir.

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!"
  • Workers are permanent and hold immutable state (a database connection, for example).
  • Workers are issued only one job at a time, a job is only ever removed from the queue when it succeeds or is instructed to abandon it.
  • Queues can exist locally, on another node in the cluster, in your Ecto database, or on a remote queue server (rabbitmq, etc...).
  • If a worker crashes while processing a job, the job is recovered and a "failure mode" (abandon, move, retry, etc) is executed.
  • Jobs are enqueued using async/3 and you can receive replies with yield/2, somewhat like Task.
  • Queues, workers, dispatch strategies and failure/success modes are all plugable with user modules.
  • Can optionally heal your cluster after a disconnect or downed node.

Honeydew attempts to provide "at least once" job execution, it's possible that circumstances could conspire to execute a job, and prevent Honeydew from reporting that success back to the queue. I encourage you to write your jobs idempotently.

Honeydew isn't intended as a simple resource pool, the user's code isn't executed in the requesting process. Though you may use it as such, there are likely other alternatives that would fit your situation better, perhaps try sbroker.

tl;dr

  • Check out the examples.
  • Enqueue jobs with Honeydew.async/3.
  • Receive responses with Honeydew.yield/2.
  • Emit job progress with progress/1
  • Queue/Worker status with Honeydew.status/1
  • Suspend and resume with Honeydew.suspend/1 and Honeydew.resume/1
  • List jobs with Honeydew.filter/2
  • Move jobs with Honeydew.move/2
  • Cancel jobs with Honeydew.cancel/2

Ecto Poll Queue

The Ecto Poll Queue is designed to painlessly turn an already-existing Ecto schema into a queue, using your repo as the backing store. This eliminates the possiblity of your database and work queue becoming out of sync, as well as eliminating the need to run a separate queue node.

Check out the included example project, and its README.

Getting Started

In your mix.exs file:

defp deps do
  [{:honeydew, "~> 1.2.6"}]
end

README

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

Also check out the README files included with the examples.

TODO:

  • statistics?
  • yield_many/2 support?
  • benchmark mnesia queue's dual filter implementations, discard one?

honeydew's People

Contributors

koudelka avatar aaronrenner avatar rodrigues avatar amokan avatar bokner avatar evadne avatar giodamelio avatar janpieper avatar feymartynov avatar pragtob avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.