Class: MultipleMan::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/multiple_man/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Configuration

Returns a new instance of Configuration.



4
5
6
7
8
9
10
11
# File 'lib/multiple_man/configuration.rb', line 4

def initialize
  self.topic_name = "multiple_man"
  self.app_name = Rails.application.class.parent.to_s if defined?(Rails)
  self.enabled = true
  self.channel_pool_size = 5
  self.worker_concurrency = 1
  self.reraise_errors = true
end

Instance Attribute Details

#app_name ⇒ Object

Returns the value of attribute app_name.



21
22
23
# File 'lib/multiple_man/configuration.rb', line 21

def app_name
  @app_name
end

#channel_pool_size ⇒ Object

Returns the value of attribute channel_pool_size.



21
22
23
# File 'lib/multiple_man/configuration.rb', line 21

def channel_pool_size
  @channel_pool_size
end

#connection ⇒ Object

Returns the value of attribute connection.



21
22
23
# File 'lib/multiple_man/configuration.rb', line 21

def connection
  @connection
end

#enabled ⇒ Object

Returns the value of attribute enabled.



21
22
23
# File 'lib/multiple_man/configuration.rb', line 21

def enabled
  @enabled
end

#error_handler ⇒ Object

Returns the value of attribute error_handler.



21
22
23
# File 'lib/multiple_man/configuration.rb', line 21

def error_handler
  @error_handler
end

#logger ⇒ Object



13
14
15
# File 'lib/multiple_man/configuration.rb', line 13

def logger
  @logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
end

#reraise_errors ⇒ Object

Returns the value of attribute reraise_errors.



21
22
23
# File 'lib/multiple_man/configuration.rb', line 21

def reraise_errors
  @reraise_errors
end

#topic_name ⇒ Object

Returns the value of attribute topic_name.



21
22
23
# File 'lib/multiple_man/configuration.rb', line 21

def topic_name
  @topic_name
end

#worker_concurrency ⇒ Object

Returns the value of attribute worker_concurrency.



21
22
23
# File 'lib/multiple_man/configuration.rb', line 21

def worker_concurrency
  @worker_concurrency
end

Instance Method Details

#on_error(&block) ⇒ Object



17
18
19
# File 'lib/multiple_man/configuration.rb', line 17

def on_error(&block)
  @error_handler = block
end