Sha256: edb5129a3bd8bf9f57b9fd503b819ca6885f5f58d45f437da9683e1e85a2865d

Contents?: true

Size: 722 Bytes

Versions: 8

Compression:

Stored size: 722 Bytes

Contents

class FrenzyBunnies::QueueFactory
  def initialize(connection)
    @connection = connection
  end

  def build_queue(name, options)
    exchange_name = options[:exchange] || 'frenzy_bunnies'
    exchange_type = options[:exchange_type] || :direct
    routing_key = options[:routing_key] || name
    durable = options[:durable]
    prefetch = options[:prefetch]
    arguments = options[:arguments] || {}

    channel = @connection.create_channel
    channel.prefetch = prefetch

    exchange = channel.exchange(exchange_name, :type => exchange_type, :durable => durable)

    queue = channel.queue(name, :durable => durable, :arguments => arguments)
    queue.bind(exchange, :routing_key => routing_key)
    queue
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
boardintel_frenzy_bunnies-0.0.17-java lib/frenzy_bunnies/queue_factory.rb
boardintel_frenzy_bunnies-0.0.16 lib/frenzy_bunnies/queue_factory.rb
boardintel_frenzy_bunnies-0.0.15 lib/frenzy_bunnies/queue_factory.rb
boardintel_frenzy_bunnies-0.0.14 lib/frenzy_bunnies/queue_factory.rb
boardintel_frenzy_bunnies-0.0.13 lib/frenzy_bunnies/queue_factory.rb
boardintel_frenzy_bunnies-0.0.12 lib/frenzy_bunnies/queue_factory.rb
boardintel_frenzy_bunnies-0.0.11 lib/frenzy_bunnies/queue_factory.rb
boardintel_frenzy_bunnies-0.0.9 lib/frenzy_bunnies/queue_factory.rb