Sha256: 719518e6168a349c9f42b3b682455c5d0a52c0a21ae2d937aac45e336477f20a

Contents?: true

Size: 740 Bytes

Versions: 24

Compression:

Stored size: 740 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 AnonymousEntityMixin

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

      def dup
        if anonymous?
          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 # AnonymousEntityMixin
  end # Client
end # AMQ

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
amq-client-0.7.0.alpha23 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha22 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha21 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha20 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha19 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha18 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha17 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha16 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha15 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha14 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha13 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha12 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha11 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha10 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha9 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha8 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha7 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha6 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha5 lib/amq/client/mixins/anonymous_entity.rb
amq-client-0.7.0.alpha4 lib/amq/client/mixins/anonymous_entity.rb