Skip to content

tylermercier/coordinator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Ruby gem for coordinating multiple redis queues

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •