Project

disquo

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Concurrent background workers on top of Disque
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

Disquo

Build Status License

Minimalist, threaded high-performance Ruby workers on top of Disque.

Installation

Add this to your Gemfile:

gem 'disquo'

Then execute:

$ bundle

Usage

Define a job:

require 'disquo'

class MyJob
  include Disquo::Job

  job_options queue: "notdefault", ttl: 3600, async: true

  def perform(msg)
    $stdout.puts "Hello #{msg}!"
  end
end

# Enqueue with override
MyJob.enqueue ["World"], ttl: 7200

Create a worker config file:

queues: ["default", "notdefault"]
concurrency: <%= ENV['NUM_THREADS'] || 20 %>

Start a worker:

$ RACK_ENV=production disquo -C config/disquo.yaml -r config/environment.rb
I, [#12581]  INFO -- : Starting worker - queues: ["default", "notdefault"], concurrency: 20
I, [#12581]  INFO -- : Process {"klass":"MyJob","args":["World"]} - thread: 7807s, job: DI8613f71b34be272dff91e63fa576340076f169bf05a0SQ
...