Giter Club home page Giter Club logo

honeydew's Introduction

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

Build Status Hex pm

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

  • 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 mode is 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 included example project, and its README.

Getting Started

In your mix.exs file:

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

Deployment

If you're using the Mnesia queue (the default), you'll need tell your release system to include the :mnesia application.

In your mix.exs file:

def application do
  [
    extra_applications: [:mnesia]
  ]
end

tl;dr

  • Check out the examples.
  • Enqueue jobs with Honeydew.async/3, delay jobs by passing delay_secs: <integer>.
  • 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

README

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.

CHANGELOG

It's worth keeping abreast with the CHANGELOG

honeydew's People

Contributors

koudelka avatar aaronrenner avatar janpieper avatar nathanl avatar rodrigues avatar amokan avatar bokner avatar evadne avatar giodamelio avatar vihu avatar feymartynov avatar pragtob avatar x4lldux avatar hauleth avatar

Watchers

James Cloos 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.