Circle CI

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

  subscriber_options channels: ['channel_one', 'channel_two']
  subscriber_error do |error|
    # do something with error
  end

  def process_message(channel, message)
    # your custom stuff here
  end
end

LICENSE

MIT

Contributing

  1. Fork it
  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