Sha256: f3cf29368c79b3cd13aa6f9f3be29dea0277fadae13ccc5657403e1a15fe4a33

Contents?: true

Size: 581 Bytes

Versions: 5

Compression:

Stored size: 581 Bytes

Contents

require 'em-synchrony'
require 'amqp'
require 'goliath'

module Rodent
  module Goliath
    class Plugin
      def initialize(address, port, config, status, logger)
        @port = port
        @status = status
        @config = config
        @logger = logger
      end

      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
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rodent-0.0.7 lib/rodent/goliath/plugin.rb
rodent-0.0.6 lib/rodent/goliath/plugin.rb
rodent-0.0.4 lib/rodent/goliath/plugin.rb
rodent-0.0.3 lib/rodent/goliath/plugin.rb
rodent-0.0.2 lib/rodent/goliath/plugin.rb