Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

bsm/disquo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
...

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages