Project

rapidjob

0.0
No commit activity in last 3 years
No release in over 3 years
RapidJob is a RabbitMQ-backed Ruby library for processing background jobs.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.3

Runtime

>= 0
>= 2.7.0
>= 0
>= 0
 Project Readme

RapidJob

RapidJob is a RabbitMQ-backed Ruby library for processing background jobs.

It's not complete yet!

Any class can include Rapid::Job.

class MyJob
  include Rapid::Job

  retry_count 5

  retry_delays [10, 20, 30, 40, 50]

  def self.fail
    puts 
  end

  def to_json
    '{}'
  end

  def self.from_json json_message
    new
  end

  def f s
    puts "hey hey hey, f is called: #{s}"
  end

  def self.g
    puts 'hey hey hey, g is called'
  end

  def self.h a, b
    puts "h is called with a: #{a}, b: #{b}"
  end
end

Then it's functions can be called in background:

mg = MyJob.new
mg.rapid.f "Salaam"

MyJob.rapid.g

MyJob.rapid.mission(g: nil, h: [1, 2])

To pop messages from MQ and run:

rake rapid:worker QUEUE=my_job