Sha256: d69b263a02103939bc665ab2ccc55baa68812796eba8b0585c0070016564e160

Contents?: true

Size: 1.56 KB

Versions: 3

Compression:

Stored size: 1.56 KB

Contents

module Appfuel
  module Service
    module Config
      # Defines the configuration for the whole worker. It basically has two
      # child definitions :db and :sneakers
      #
      # Configuration Overview
      #
      # env:        The environement this worker is deployed as dev, qa, stg, prod
      # logfile:    The location of the application log file if the value is
      #             stdout or stderr it will use that instead
      # dispatchers List of workers that dispatch messages to actions. The reason
      #             why you would want more than one is to use different exchange
      #             types
      #
      # db          Database configuration please see sp_offers/config/database
      # sneakers    RabbitMQ configuration please see sp_offers/config/sneakers
      # aws         Configuration S3 where we store our documents
      # @return Definition
      def self.worker_definition
        Appfuel::Configuration.define :worker do
          file 'config/app.yaml'
          defaults logfile: 'stdout',
                    audit_logfile: 'stdout'

          validator {
            required(:env).filled(:str?)
            required(:logfile).filled(:str?)
            required(:audit_logfile).filled(:str?)
            # Children will be validated on there own
            # we are just ensuring they exist
            required(:db).filled(:hash?)
            required(:sneakers).filled(:hash?)
          }
          self << [
            Config.sneakers_definition,
            Config.db_definition,
          ]
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
appfuel-service-0.1.7 lib/appfuel/service/config/worker.rb
appfuel-service-0.1.6 lib/appfuel/service/config/worker.rb
appfuel-service-0.1.4 lib/appfuel/service/config/worker.rb