Class: Rodent::Goliath::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/rodent/goliath/plugin.rb

Instance Method Summary collapse

Constructor Details

#initialize(address, port, config, status, logger) ⇒ Plugin

Returns a new instance of Plugin.



8
9
10
11
12
13
# File 'lib/rodent/goliath/plugin.rb', line 8

def initialize(address, port, config, status, logger)
  @port = port
  @status = status
  @config = config
  @logger = logger
end

Instance Method Details

#run(connection_string = 'amqp://guest:guest@localhost', pool_size = 50) ⇒ Object



15
16
17
18
19
20
# File 'lib/rodent/goliath/plugin.rb', line 15

def run(connection_string = 'amqp://guest:guest@localhost', pool_size = 50)
  @config['amqp'] = AMQP.connect(connection_string)
  @config['channels'] = EM::Synchrony::ConnectionPool.new(size: pool_size) do
    AMQP::Channel.new(@config['amqp'])
  end
end