Popularity
1.5
Growing
Activity
0.0
Stable
0
3
3

Description

An Active Job compatible queueing interface. This library will allow you to enqueue jobs on your existing Active Job compatible backend. This is particularly useful if you're strangling your existing Rails project to death.

The intention is to fully support any and all backends that Active Job supports. Pull requests are much appreciated.

Monthly Downloads: 12
Programming language: Elixir
License: MIT License
Tags: Queue     ActiveJob     Sidekiq    
Latest version: v0.1.2

ActiveJorb alternatives and similar packages

Based on the "Queue" category.
Alternatively, view ActiveJorb alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of ActiveJorb or a related project?

Add another 'Queue' Package

README

ActiveJorb CircleCI

An Active Job compatible queueing interface. This library will allow you to enqueue jobs on your existing Active Job compatible backend. This is particularly useful if you're strangling your existing Rails project to death.

The intention is to fully support any and all backends that Active Job supports. Pull requests are much appreciated.

Installation

def deps do
  [
    {:active_jorb, "~> 0.1.0"}
  ]
end

Supported Backends

Backend Supported? Add to mix.exs Link
Sidekiq Yes {:sidewalk, "~> 0.3.4} https://hex.pm/packages/sidewalk
Resque No (#6)
Que No (#4)
Queue Classic No (#5)
Backburner No (#3)
Sneakers No (#7)

Usage

After installing the dependency for your required backend, it's recommended that you proxy access to the supported queue adapter in your application:

# config/dev.exs
config :my_application, MyApplication,
  job_queue_adapter: ActiveJorb.QueueAdapter.Sidekiq

# config/test.exs
config :my_application, MyApplication,
  job_queue_adapter: ActiveJorb.QueueAdapter.Test

# lib/my_application/job_queue.ex
defmodule MyApplication.JobQueue do
  @queue_adapter Application.get_env(:my_application, :job_queue_adapter)

  defdelegate enqueue(job), to: @queue_adapter
  defdelegate enqueue_at(job), to: @queue_adapter
end

To enqueue a job you must first construct an %ActiveJorb.Job{}, and then pass it to the enqueue method of choice:

iex> job = %ActiveJorb.Job{job_class: "MyJob", arguments: [1, 2, 3]}
iex> MyApplication.JobQueue.enqueue(job)
{:ok, "some-job-id"}

iex> ts = ~N[2019-01-01 12:30:00]
iex> MyApplication.JobQueue.enqueue_at(job, ts)
{:ok, "some-other-job-id"}

Testing

See ActiveJorb.QueueAdapters.Test.

Prior Art, Credit, and Thanks

  • All of the maintainers of Active Job
  • The various authors of any supported backend
  • The various authors of any Elixir library supporting those backends