Jorb

Coach Z

I uh, I say you did a great jorb out there

What

Jorb is a simple queue-based jobs processing system for Elixir. Works great with Amazon SQS.

How

Define your job module:

defmodule HelloWorld.Job do
  use Jorb.Job

  def read_queues do
    ["high_priority_greetings", "regular_greetings"]
  end

  def write_queue(greeting) do
    if greeting["name"] == "Zeke" do
      "high_priority_greetings"
    else
      "regular_greetings"
    end
  end

  def perform(greeting) do
    IO.puts "Hello, #{greeting["name"]}!"
    :ok
  end
end

Enqueue work:

HelloWorld.Job.enqueue(%{"name" => "Ray"})

Perform work:

# poll queues once
HelloWorld.Job.work(read_timeout: 1000, perform_timeout: 5000)

# poll queues forever
HelloWorld.Job.workers(worker_count: 2, read_interval: 1000)
|> Supervisor.start_link(strategy: :one_for_one)

Installation

Put the following into your mix.exs file's deps function:

{:jorb, "~> 0.4.0"}

Configuration

In order of priority, configs can be provided by:

Options:

Installation

If available in Hex, the package can be installed by adding jorb to your list of dependencies in mix.exs:

def deps do
  [
    {:jorb, "~> 0.3.0"}
  ]
end

Authorship & License

Jorb is copyright 2018 Appcues, Inc.

Jorb is licensed under the MIT license.

A Jorb Well Done is by The Brothers Chaps.