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