Sha256: acd29b9734b89ebd4f0252e54519efb02648dba3f40e0a497ececff2ae183f99

Contents?: true

Size: 814 Bytes

Versions: 12

Compression:

Stored size: 814 Bytes

Contents

# encoding: utf-8

module AMQ
  module Client
    # Common behavior of AMQ entities that can be either client or server-named, for example, exchanges and queues.
    module ServerNamedEntity

      # @return [Boolean] true if this entity is anonymous (server-named)
      def server_named?
        @name.nil? or @name.empty?
      end
      # backwards compabitility. MK.
      alias anonymous? server_named?

      def dup
        if server_named?
          raise RuntimeError.new("You can't clone anonymous queue until it receives back the name in Queue.Declare-Ok response. Move the code with #dup to the callback for the #declare method.") # TODO: that's not true in all cases, imagine the user didn't call #declare yet.
        end
        super
      end
    end # ServerNamedEntity
  end # Client
end # AMQ

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
amq-client-0.7.0.alpha35 lib/amq/client/server_named_entity.rb
amq-client-0.7.0.alpha34 lib/amq/client/server_named_entity.rb
amq-client-0.7.0.alpha33 lib/amq/client/server_named_entity.rb
amq-client-0.7.0.alpha32 lib/amq/client/server_named_entity.rb
amq-client-0.7.0.alpha31 lib/amq/client/server_named_entity.rb
amq-client-0.7.0.alpha30 lib/amq/client/server_named_entity.rb
amq-client-0.7.0.alpha29 lib/amq/client/server_named_entity.rb
amq-client-0.7.0.alpha28 lib/amq/client/server_named_entity.rb
amq-client-0.7.0.alpha27 lib/amq/client/server_named_entity.rb
amq-client-0.7.0.alpha26 lib/amq/client/server_named_entity.rb
amq-client-0.7.0.alpha25 lib/amq/client/server_named_entity.rb
amq-client-0.7.0.alpha24 lib/amq/client/server_named_entity.rb