class Warren::App::ConsumerStart

Handles the initial creation of the configuration object

Public Class Methods

invoke(shell, options) click to toggle source

Starts up a warren client process for the configured consumers.

@param shell [Thor::Shell::Basic] Thor shell instance for feedback @param options [Hash] Hash of command line arguments from Thor @option options [String] :path Path to the `warren_consumers.yml `file @option options [Array<String>] :consumers Array of configured consumers to start.

Defaults to all consumers

@return [Void]

# File lib/warren/app/consumer_start.rb, line 21
def self.invoke(shell, options)
  new(shell, options).invoke
end
new(shell, options) click to toggle source
# File lib/warren/app/consumer_start.rb, line 25
def initialize(shell, options)
  @shell = shell
  @config = Warren::Config::Consumers.new(options[:path])
  @consumers = options[:consumers]
end

Public Instance Methods

invoke() click to toggle source

Starts up a warren client process for the configured consumers.

@return [Void]

# File lib/warren/app/consumer_start.rb, line 35
def invoke
  Warren::Client.new(@config, consumers: @consumers).run
end