StartHer
Microservices common stuff. Implement redis subscription and logging strategy.
Requirements
- Ruby >= 2.2
- Redis >= 2.8
Installation
gem 'start_her'
Configuration
require 'start_her'
StartHer.configure do |config|
config.redis = {
url: 'redis://localhost:6379',
namespace: 'namespace'
db: 1
}
config.logger = StartHer::Logger.instance # default
config.logstash_url = 'redis://localhost:6379' # if using default logger in production
end
Usage
bundle exec starther ./lib/path/to/subscriber.rb
Note: You need to put your subscriber.rb
file into the lib
directory.
Subscriber class
class Subscriber
include StartHer::Subscriber
channels: ['channel_one', 'channel_two']
subscriber_error do |error|
# do something with error
end
def (channel, )
# your custom stuff here
end
end
LICENSE
MIT
Contributing
- Fork it
- 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 new Pull Request