Ruby gem for coordinating multiple redis queues
Ruby Shell
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
.ruby-version
.travis.yml
Gemfile
LICENSE.txt
README.md
Rakefile
coordinator.gemspec

README.md

Coordinator

Ruby gem for coordinating multiple redis queues

Status

Gem Version Build Status Code Climate

Installation

Add this line to your application's Gemfile:

gem 'coordinator'

And then execute:

$ bundle

Or install it yourself as:

$ gem install coordinator

Usage

@coordinator = Coordinator::Base.new([
  Coordinator::Queue.new("high"),
  Coordinator::Queue.new("medium"),
  Coordinator::Queue.new("low")
])

@coordinator.add_task("high", 1)
@coordinator.add_task("medium", 2)
@coordinator.add_priority_task("high", 3)

@coordinator.length_all # returns 3
@coordinator.peek_all # returns [3, 2]

@coordinator.next_task(["high"]) # returns 3
@coordinator.next_task(["medium"]) # returns 2

Contributing

  1. Fork it ( http://github.com//coordinator/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request