Skip to content
Jorb is a simple jobs publisher/processor for Elixir
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
lib
test
.formatter.exs
.gitignore
LICENSE.txt
README.md
mix.exs
mix.lock

README.md

Jorb

Coach Z

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

Jorb is a simple Elixir library for publishing jobs to SQS and running them later

Example

First, define a job module:

defmodule Demo.Jobs.TestJob do
   use Jorb.Job

   def queue_name, do: "test"
   def perform(name) do
     IO.puts("Hello #{name}")
   end
end

Then, queue jobs to be performed later with perform_async

  Demo.Jobs.TestJob.perform_async("Andy")

Configuring

Jorb uses ExAws under the hood to push/pull from SQS, so configure your AWS keys like you would for ExAws.

There are a few config options that need to be set for Jorb to run correctly. Here is the default config:

config :jorb,
  application: :jorb,
  fetching_processes: 4,
  fetching_timer: 1000,
  namespace: "Elixir.Jorb.Jobs.",
  backend: Jorb.Backend.SQS,
  environment: 'dev'
  • application: this is the name of your app (the same one from mix.exs)
  • fetching_processes: this is how many processes are pulling from SQS simultaneously PER QUEUE
  • fetching_timer: this is how often the fetchers poll SQS
  • namespace: this is the namespace that your jobs (things useing Jorb.Job) live in.
  • backend: this is anything that implements the Jorb.Backend protocol.
  • environment: the env that Jorb is running in. Needed because libraries' Mix.env is always :prod

It is important that your jobs share a namespace, so that Jorb can automatically find out the names of the queues that need to be pulled from.

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.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/jorb.

Authorship & License

Jorb is copyright 2018 Appcues, Inc.

Jorb is licensed under the MIT license

A Jorb Well Done is by The Brothers Chaps

You can’t perform that action at this time.