Gru
Manage worker/minion counts in an atomic fashion.
Installation
Add this line to your application's Gemfile:
gem 'gru'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gru
Usage
require 'gru'
require 'redis'
require 'logger'
client = Redis.new
class Gru::Adapters::RedisAdapter
def hostname
@hostname ||= ARGV[0]
end
end
settings = {
host_maximums: { 'test_worker' => 5 },
cluster_maximums: { 'test_worker' => 10 },
rebalance_flag: true
}
manager = Gru.create(settings)
logger = Logger.new(STDOUT)
loop do
logger.info("STATE: #{manager.adjust_workers.inspect}")
sleep(1)
end
More to come soon!
Contributing
- Fork it ( https://github.com/[my-github-username]/gru/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request