Sha256: e09c684ae3def0ead98fde024c0c4b0a7a404360bea9eeb36522f2d0174594bd
Contents?: true
Size: 1.13 KB
Versions: 53
Compression:
Stored size: 1.13 KB
Contents
module ActivePublisher module Async module InMemoryAdapter ## # This class is a wrapper around bunny and march hare channels to cache exchanges. # Bunny does this by default, but march hare will perform a blocking wait for each # exchange declaration. # class Channel attr_reader :rabbit_channel, :topic_exchange_cache def initialize @topic_exchange_cache = {} @rabbit_channel = ::ActivePublisher::Connection.connection.create_channel end def close rabbit_channel.close end def confirm_select rabbit_channel.confirm_select end def topic(exchange) topic_exchange_cache[exchange] ||= rabbit_channel.topic(exchange) end def using_publisher_confirms? rabbit_channel.using_publisher_confirms? end def wait_for_confirms(timeout) if rabbit_channel.method(:wait_for_confirms).arity > 0 rabbit_channel.wait_for_confirms(timeout) else rabbit_channel.wait_for_confirms end end end end end end
Version data entries
53 entries across 53 versions & 1 rubygems