All Projects → eidge → ex_job

eidge / ex_job

Licence: other
ExJob is a zero-dependency, ultra-fast, background job processing library.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to ex job

celery.node
Celery task queue client/worker for nodejs
Stars: ✭ 164 (+1071.43%)
Mutual labels:  background-jobs, queued-jobs, queue-workers
filequeue
light weight, high performance, simple, reliable and persistent queue for Java applications
Stars: ✭ 35 (+150%)
Mutual labels:  queued-jobs, queue-workers
Celery
Distributed Task Queue (development branch)
Stars: ✭ 18,378 (+131171.43%)
Mutual labels:  queued-jobs, queue-workers
bikeshed
Lock free hierarchical work scheduler
Stars: ✭ 78 (+457.14%)
Mutual labels:  queued-jobs, queue-workers
Background
Runs things in the background.
Stars: ✭ 497 (+3450%)
Mutual labels:  background-jobs, jobs
Sidekiq
Simple, efficient background processing for Ruby
Stars: ✭ 11,450 (+81685.71%)
Mutual labels:  background-jobs, jobs
joobq
JoobQ is a fast, efficient asynchronous reliable job queue and job scheduler library processing. Jobs are submitted to a job queue, where they reside until they are able to be scheduled to run in a computing environment.
Stars: ✭ 26 (+85.71%)
Mutual labels:  background-jobs, jobs
awesome-job-boards
A curated list of awesome job boards. We accept PRs.
Stars: ✭ 21 (+50%)
Mutual labels:  jobs
front-end-javascript-react-kullanan-sirketler
Front-end alaninda JavaScript React kullanan ve bu yonde is ilanlari yayinlayan sirketlerin listesinin yer aldigi acik kaynak amme hizmeti.
Stars: ✭ 24 (+71.43%)
Mutual labels:  jobs
vagas
Mural de vagas para desenvolvedor Android.
Stars: ✭ 748 (+5242.86%)
Mutual labels:  jobs
occupationcoder
Given a job title and job description, the algorithm assigns a standard occupational classification (SOC) code to the job.
Stars: ✭ 30 (+114.29%)
Mutual labels:  jobs
zenaton-ruby
💎 Ruby gem to run and orchestrate background jobs with Zenaton Workflow Engine
Stars: ✭ 32 (+128.57%)
Mutual labels:  background-jobs
django-berlin
🍀 Ever wondered who's doing Django... in Berlin?
Stars: ✭ 65 (+364.29%)
Mutual labels:  jobs
nodejs-talent
Node.js client for Google Cloud Talent Solutions. Transform your job search and candidate matching capabilities with Cloud Talent Solution.
Stars: ✭ 21 (+50%)
Mutual labels:  jobs
chambas
La bolsa de trabajo para hackers cívicos.
Stars: ✭ 40 (+185.71%)
Mutual labels:  jobs
qa-jobs-in-portugal
An awesome curated list of the most recent QA job openings in Portugal 🇵🇹 updated every day! 🆕
Stars: ✭ 36 (+157.14%)
Mutual labels:  jobs
react-native-sync-adapter
Schedule background data synchronization using React Native.
Stars: ✭ 112 (+700%)
Mutual labels:  background-jobs
DSA
DSA placements preparation guide. Includes DSA Python codes.
Stars: ✭ 141 (+907.14%)
Mutual labels:  jobs
hangfire-dashboard-customize
Customize your Hangfire Dashboard (e.g. Change the Title of the Dashboard)
Stars: ✭ 19 (+35.71%)
Mutual labels:  background-jobs
Coder
求职信息 组队刷题 经验交流
Stars: ✭ 22 (+57.14%)
Mutual labels:  jobs

ExJob

ExJob is a zero-dependency, ultra-fast (1), background job processing library.

All you need is ExJob, no Redis, no internal or external dependencies. Running ExJob is as simple as adding it to your dependencies and start writing your first job.

Usage

ExJob's interface is very similar to other job processing libraries such as Toniq or Exq.

You'll need to defined a job handler:

defmodule App.WelcomeEmail do
  use ExJob.Job

  def perform(user) do
    App.Mailer.send_welcome_email(user)
  end
end

And then enqueue your job:

user = UserRepo.first
#=> %App.User{name: "Jon", email: "[email protected]"}
ExJob.enqueue(App.WelcomeEmail, [user])
#=> :ok

Note that because ExJob is implemented in pure elixir, you can pass any elixir term to the enqueue function (such as an Ecto struct) as it will not be serialized.

Grouping Jobs

By default, ExJob will run each of your jobs concurrently in a different process. But sometimes you'll want your jobs to be processed synchronously.

ExJob allows you to define a group_by function inside your job module. Jobs for which group_by returns the same value will run synchronously in the order they were enqueued.

Let's say you wanted to send multiple text messages to your users, but you want to preserve order:

defmodule App.Jobs.SendTextMessage do
  use ExJob.Job

  def group_by(%User{id: id}, _message_type), do: id

  def perform(user, message_type) do
    text = App.Messages.for(message_type)
    number = user.phone_number
    Twilio.send(to: number, text: text)
  end
end

You can now enqueue as many messages as you want, and they will be processed in the same order as you enqueued them:

user = UserRepo.first
ExJob.enqueue(App.Jobs.SendTextMessage, [user, :welcome])
ExJob.enqueue(App.Jobs.SendTextMessage, [user, :first_use_voucher])
ExJob.enqueue(App.Jobs.SendTextMessage, [user, :more_spam])

Installation

Add :ex_job to your mix.exs dependencies.

def deps do
  [
    {:ex_job, "~> 0.2.0"}
  ]
end

ExJob runs as an OTP app, so you will need to add it to your applications as well:

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

Documentation

Documentation is mainly unwritten yet, but it can be found here: Documentation

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].