lib/tennis/configuration.rb in tennis-jobs-0.3.1 vs lib/tennis/configuration.rb in tennis-jobs-0.4.0
- old
+ new
@@ -1,28 +1,27 @@
+require "logger"
+require "celluloid"
+
module Tennis
class Configuration
DEFAULT = {
async: true,
- exchange: "tennis",
- workers: 4,
- logger: STDOUT,
- sneakers_options: {},
+ logger: Logger.new(STDOUT),
}.freeze
- attr_accessor :async, :exchange, :workers, :logger, :sneakers_options
+ attr_accessor :async, :logger, :backend
def initialize(opts = {})
DEFAULT.merge(opts).each do |name, value|
__send__("#{name}=", value)
end
end
def finalize!
- Sneakers.configure({
- exchange: exchange,
- workers: workers,
- log: logger,
- }.merge(sneakers_options))
+ raise "You must specify a backend during the configuration" unless backend
+
+ # Set the celluloid logger.
+ Celluloid.logger = logger
end
end
end