amqp 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +0 -1
- data/examples/issues/issue_94.rb +23 -0
- data/lib/amqp/queue.rb +1 -0
- data/lib/amqp/version.rb +1 -1
- data/spec/integration/queue_status_spec.rb +44 -0
- metadata +6 -4
    
        data/CHANGELOG
    CHANGED
    
    | @@ -2,7 +2,6 @@ | |
| 2 2 |  | 
| 3 3 | 
             
              * [BUG] Server-named queues declared en masse now get their unique names instead of all beign assigned the first generated name
         | 
| 4 4 | 
             
              * [API] Connection URI (string) format for vhosts no longer assumes that vhosts begin with a slash (/), learn more at http://bit.ly/mfzwcB
         | 
| 5 | 
            -
              * [BUG] Heartbeats broken for long running tasks [#43]
         | 
| 6 5 | 
             
              * [BUG] Queue#reset leaks consumer tags [#40].
         | 
| 7 6 |  | 
| 8 7 | 
             
            = Version 0.7.1
         | 
| @@ -0,0 +1,23 @@ | |
| 1 | 
            +
            #!/usr/bin/env ruby
         | 
| 2 | 
            +
            # encoding: utf-8
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            require "bundler"
         | 
| 5 | 
            +
            Bundler.setup
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            $:.unshift(File.expand_path("../../../lib", __FILE__))
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            require "amqp"
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            puts "Running amqp gem #{AMQP::VERSION}"
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            AMQP.start(:host => '127.0.0.1') do |connection|
         | 
| 14 | 
            +
              channel  = AMQP::Channel.new(connection)
         | 
| 15 | 
            +
              exchange = channel.direct("")
         | 
| 16 | 
            +
              queue    = channel.queue("indexer_queue", { :durable => true })
         | 
| 17 | 
            +
             | 
| 18 | 
            +
              EM.add_periodic_timer(1) {
         | 
| 19 | 
            +
                queue.status do |num_messages, num_consumers|
         | 
| 20 | 
            +
                  puts "msgs:#{num_messages}"
         | 
| 21 | 
            +
                end
         | 
| 22 | 
            +
              }
         | 
| 23 | 
            +
            end
         | 
    
        data/lib/amqp/queue.rb
    CHANGED
    
    
    
        data/lib/amqp/version.rb
    CHANGED
    
    
| @@ -0,0 +1,44 @@ | |
| 1 | 
            +
            # encoding: utf-8
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            require 'spec_helper'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            describe AMQP::Queue do
         | 
| 6 | 
            +
             | 
| 7 | 
            +
              #
         | 
| 8 | 
            +
              # Environment
         | 
| 9 | 
            +
              #
         | 
| 10 | 
            +
             | 
| 11 | 
            +
              include EventedSpec::AMQPSpec
         | 
| 12 | 
            +
             | 
| 13 | 
            +
              default_timeout 5
         | 
| 14 | 
            +
             | 
| 15 | 
            +
             | 
| 16 | 
            +
             | 
| 17 | 
            +
              #
         | 
| 18 | 
            +
              # Examples
         | 
| 19 | 
            +
              #
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              describe "#status" do
         | 
| 22 | 
            +
                it "yields # of messages & consumers to the callback" do
         | 
| 23 | 
            +
                  events  = []
         | 
| 24 | 
            +
                  channel = AMQP::Channel.new
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                  queue1 = channel.queue("", :auto_delete => true)
         | 
| 27 | 
            +
                  queue2 = channel.queue("amqpgem.tests.a.named.queue", :auto_delete => true)
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                  EventMachine.add_timer(1.0) do
         | 
| 30 | 
            +
                    queue1.status do |m, c|
         | 
| 31 | 
            +
                      events << :queue1_declare_ok
         | 
| 32 | 
            +
                    end
         | 
| 33 | 
            +
                    queue2.status do |m, c|
         | 
| 34 | 
            +
                      events << :queue2_declare_ok
         | 
| 35 | 
            +
                    end        
         | 
| 36 | 
            +
                  end
         | 
| 37 | 
            +
             | 
| 38 | 
            +
                  done(2.0) {
         | 
| 39 | 
            +
                    events.should include(:queue1_declare_ok)
         | 
| 40 | 
            +
                    events.should include(:queue2_declare_ok)
         | 
| 41 | 
            +
                  }
         | 
| 42 | 
            +
                end
         | 
| 43 | 
            +
              end
         | 
| 44 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,13 +1,13 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: amqp
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              hash:  | 
| 4 | 
            +
              hash: 5
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
              segments: 
         | 
| 7 7 | 
             
              - 0
         | 
| 8 8 | 
             
              - 7
         | 
| 9 | 
            -
              -  | 
| 10 | 
            -
              version: 0.7. | 
| 9 | 
            +
              - 3
         | 
| 10 | 
            +
              version: 0.7.3
         | 
| 11 11 | 
             
            platform: ruby
         | 
| 12 12 | 
             
            authors: 
         | 
| 13 13 | 
             
            - Aman Gupta
         | 
| @@ -17,7 +17,7 @@ autorequire: | |
| 17 17 | 
             
            bindir: bin
         | 
| 18 18 | 
             
            cert_chain: []
         | 
| 19 19 |  | 
| 20 | 
            -
            date: 2011-07- | 
| 20 | 
            +
            date: 2011-07-19 00:00:00 +04:00
         | 
| 21 21 | 
             
            default_executable: 
         | 
| 22 22 | 
             
            dependencies: 
         | 
| 23 23 | 
             
            - !ruby/object:Gem::Dependency 
         | 
| @@ -110,6 +110,7 @@ files: | |
| 110 110 | 
             
            - examples/immediately_bind_a_server_named_queue.rb
         | 
| 111 111 | 
             
            - examples/internal.rb
         | 
| 112 112 | 
             
            - examples/issues/issue_75.rb
         | 
| 113 | 
            +
            - examples/issues/issue_94.rb
         | 
| 113 114 | 
             
            - examples/logger.rb
         | 
| 114 115 | 
             
            - examples/multiclock.rb
         | 
| 115 116 | 
             
            - examples/pingpong.rb
         | 
| @@ -154,6 +155,7 @@ files: | |
| 154 155 | 
             
            - spec/integration/exchange_declaration_spec.rb
         | 
| 155 156 | 
             
            - spec/integration/queue_declaration_spec.rb
         | 
| 156 157 | 
             
            - spec/integration/queue_exclusivity_spec.rb
         | 
| 158 | 
            +
            - spec/integration/queue_status_spec.rb
         | 
| 157 159 | 
             
            - spec/integration/reply_queue_communication_spec.rb
         | 
| 158 160 | 
             
            - spec/integration/store_and_forward_spec.rb
         | 
| 159 161 | 
             
            - spec/integration/topic_subscription_spec.rb
         |