Class: DaimonSkycrawlers::Queue

Inherits:
Object
  • Object
show all
Defined in:
lib/daimon_skycrawlers/queue.rb

Overview

Wrapper for queue configuration class

Class Method Summary collapse

Class Method Details

.configurationObject

Configuration for queue



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/daimon_skycrawlers/queue.rb', line 12

def configuration
  @configuration ||= SongkickQueue.configure do |config|
    config.logger = Logger.new(STDOUT)
    config.host = "127.0.0.1"
    config.port = 5672
    # config.username = 'guest'
    # config.password = 'guest'
    config.vhost = "/"
    config.max_reconnect_attempts = 10
    config.network_recovery_interval = 1.0
  end
end

.configure {|configuration| ... } ⇒ Object

Configure queue

DaimonSkycrawlers::Queue.configure do |config|
  config.logger = Logger.new(STDOUT)
  config.host = "127.0.0.1"
  config.port = 5672
  # config.username = 'guest'
  # config.password = 'guest'
  config.vhost = "/"
  config.max_reconnect_attempts = 10
  config.network_recovery_interval = 1.0
end
  • logger: logger instance for queue system
  • host: RabbitMQ host
  • port: RabbitMQ port
  • username: RabbitMQ username
  • passowrd: RabbitMQ password
  • vhost: virtual host used for connection
  • max_reconnect_attempts: The maximum number of reconnection attempts
  • network_recovery_interval: reconnection interval for TCP connection failures

Yields:



50
51
52
# File 'lib/daimon_skycrawlers/queue.rb', line 50

def configure
  yield configuration
end