carnivore-nsq 0.1.4 → 0.1.6
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.
- checksums.yaml +4 -4
 - data/CHANGELOG.md +3 -0
 - data/lib/carnivore-nsq/nsq.rb +23 -9
 - data/lib/carnivore-nsq/version.rb +1 -1
 - metadata +27 -27
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: d4b345b1301c64e24eb4c15c6dc47d2249805440
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 15f27c1f613e2e3227e1efb244b4bd7104dc61e5
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 9db9010e58583ed20411820d53f1a032f376b6d4f96a87a15fcc16ff2efe267aeeee9a0c89abc6998b745d611aafe4c310792e772d678335ede6e7f8e9999edf
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: de4eacf46cc99d60c267317a3ec1c4225ee43f34837b48287f700bc4cb72f0359c2a718e3ddbc6d2ebf8777f57bed759315b6b18b2d75f31b3e0a6f55cd0a045
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/lib/carnivore-nsq/nsq.rb
    CHANGED
    
    | 
         @@ -5,6 +5,8 @@ module Carnivore 
     | 
|
| 
       5 
5 
     | 
    
         
             
              class Source
         
     | 
| 
       6 
6 
     | 
    
         
             
                class Nsq < Source
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
      
 8 
     | 
    
         
            +
                  trap_exit :consumer_failure
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
       8 
10 
     | 
    
         
             
                  DEFAULT_LOOKUPD_PATH = '/etc/carnivore/nsq.json'
         
     | 
| 
       9 
11 
     | 
    
         | 
| 
       10 
12 
     | 
    
         
             
                  attr_reader(
         
     | 
| 
         @@ -25,18 +27,30 @@ module Carnivore 
     | 
|
| 
       25 
27 
     | 
    
         
             
                    Krakow::Utils::Logging.level = (Carnivore::Config.get(:krakow, :logging, :level) || :info).to_sym
         
     | 
| 
       26 
28 
     | 
    
         
             
                  end
         
     | 
| 
       27 
29 
     | 
    
         | 
| 
      
 30 
     | 
    
         
            +
                  def consumer_failure
         
     | 
| 
      
 31 
     | 
    
         
            +
                    warn 'Consumer failure detected. Forcing termination and rebuilding.'
         
     | 
| 
      
 32 
     | 
    
         
            +
                    @reader.terminate
         
     | 
| 
      
 33 
     | 
    
         
            +
                    build_consumer
         
     | 
| 
      
 34 
     | 
    
         
            +
                    info "Consumer connection for #{topic}:#{channel} re-established #{reader}"
         
     | 
| 
      
 35 
     | 
    
         
            +
                  end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                  def build_consumer
         
     | 
| 
      
 38 
     | 
    
         
            +
                    consumer_args = Smash.new(
         
     | 
| 
      
 39 
     | 
    
         
            +
                      :nsqlookupd => lookupd,
         
     | 
| 
      
 40 
     | 
    
         
            +
                      :topic => topic,
         
     | 
| 
      
 41 
     | 
    
         
            +
                      :channel => channel,
         
     | 
| 
      
 42 
     | 
    
         
            +
                      :max_in_flight => args.fetch(:max_in_flight, 100),
         
     | 
| 
      
 43 
     | 
    
         
            +
                      :notifier => waiter
         
     | 
| 
      
 44 
     | 
    
         
            +
                    ).merge(reader_args)
         
     | 
| 
      
 45 
     | 
    
         
            +
                    @reader = Krakow::Consumer.new(consumer_args)
         
     | 
| 
      
 46 
     | 
    
         
            +
                    link @reader
         
     | 
| 
      
 47 
     | 
    
         
            +
                  end
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
       28 
49 
     | 
    
         
             
                  def connect
         
     | 
| 
       29 
50 
     | 
    
         
             
                    unless(callbacks.empty?)
         
     | 
| 
       30 
51 
     | 
    
         
             
                      unless(lookupd.empty?)
         
     | 
| 
       31 
     | 
    
         
            -
                         
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
                          :topic => topic,
         
     | 
| 
       34 
     | 
    
         
            -
                          :channel => channel,
         
     | 
| 
       35 
     | 
    
         
            -
                          :max_in_flight => args.fetch(:max_in_flight, 100),
         
     | 
| 
       36 
     | 
    
         
            -
                          :notifier => waiter
         
     | 
| 
       37 
     | 
    
         
            -
                        ).merge(reader_args)
         
     | 
| 
       38 
     | 
    
         
            -
                        @reader = Krakow::Consumer.new(consumer_args)
         
     | 
| 
       39 
     | 
    
         
            -
                        info "Reader connection for #{topic}:#{channel} established #{reader}"
         
     | 
| 
      
 52 
     | 
    
         
            +
                        build_consumer
         
     | 
| 
      
 53 
     | 
    
         
            +
                        info "Consumer connection for #{topic}:#{channel} established #{reader}"
         
     | 
| 
       40 
54 
     | 
    
         
             
                      end
         
     | 
| 
       41 
55 
     | 
    
         
             
                    end
         
     | 
| 
       42 
56 
     | 
    
         
             
                    if(producer_args)
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,80 +1,80 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: carnivore-nsq
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.6
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Chris Roberts
         
     | 
| 
       8 
     | 
    
         
            -
            autorequire: 
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014-12- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-12-13 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: carnivore
         
     | 
| 
       15 
     | 
    
         
            -
               
     | 
| 
      
 15 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       16 
16 
     | 
    
         
             
                requirements:
         
     | 
| 
       17 
     | 
    
         
            -
                - -  
     | 
| 
      
 17 
     | 
    
         
            +
                - - '>='
         
     | 
| 
       18 
18 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       19 
19 
     | 
    
         
             
                    version: 0.1.8
         
     | 
| 
       20 
     | 
    
         
            -
               
     | 
| 
       21 
     | 
    
         
            -
              prerelease: false
         
     | 
| 
       22 
     | 
    
         
            -
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 20 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       23 
21 
     | 
    
         
             
                requirements:
         
     | 
| 
       24 
     | 
    
         
            -
                - -  
     | 
| 
      
 22 
     | 
    
         
            +
                - - '>='
         
     | 
| 
       25 
23 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       26 
24 
     | 
    
         
             
                    version: 0.1.8
         
     | 
| 
      
 25 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 26 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
       27 
27 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       28 
28 
     | 
    
         
             
              name: krakow
         
     | 
| 
       29 
     | 
    
         
            -
               
     | 
| 
      
 29 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       30 
30 
     | 
    
         
             
                requirements:
         
     | 
| 
       31 
     | 
    
         
            -
                - -  
     | 
| 
      
 31 
     | 
    
         
            +
                - - '>='
         
     | 
| 
       32 
32 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       33 
33 
     | 
    
         
             
                    version: 0.3.6
         
     | 
| 
       34 
     | 
    
         
            -
               
     | 
| 
       35 
     | 
    
         
            -
              prerelease: false
         
     | 
| 
       36 
     | 
    
         
            -
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 34 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       37 
35 
     | 
    
         
             
                requirements:
         
     | 
| 
       38 
     | 
    
         
            -
                - -  
     | 
| 
      
 36 
     | 
    
         
            +
                - - '>='
         
     | 
| 
       39 
37 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       40 
38 
     | 
    
         
             
                    version: 0.3.6
         
     | 
| 
      
 39 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 40 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
       41 
41 
     | 
    
         
             
            description: Carnivore NSQ source
         
     | 
| 
       42 
42 
     | 
    
         
             
            email: chrisroberts.code@gmail.com
         
     | 
| 
       43 
43 
     | 
    
         
             
            executables: []
         
     | 
| 
       44 
44 
     | 
    
         
             
            extensions: []
         
     | 
| 
       45 
45 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       46 
46 
     | 
    
         
             
            files:
         
     | 
| 
       47 
     | 
    
         
            -
            - CHANGELOG.md
         
     | 
| 
       48 
     | 
    
         
            -
            - CONTRIBUTING.md
         
     | 
| 
       49 
     | 
    
         
            -
            - LICENSE
         
     | 
| 
       50 
     | 
    
         
            -
            - README.md
         
     | 
| 
       51 
     | 
    
         
            -
            - carnivore-nsq.gemspec
         
     | 
| 
       52 
47 
     | 
    
         
             
            - lib/carnivore-nsq.rb
         
     | 
| 
       53 
48 
     | 
    
         
             
            - lib/carnivore-nsq/nsq.rb
         
     | 
| 
       54 
49 
     | 
    
         
             
            - lib/carnivore-nsq/version.rb
         
     | 
| 
      
 50 
     | 
    
         
            +
            - carnivore-nsq.gemspec
         
     | 
| 
      
 51 
     | 
    
         
            +
            - README.md
         
     | 
| 
      
 52 
     | 
    
         
            +
            - CHANGELOG.md
         
     | 
| 
      
 53 
     | 
    
         
            +
            - CONTRIBUTING.md
         
     | 
| 
      
 54 
     | 
    
         
            +
            - LICENSE
         
     | 
| 
       55 
55 
     | 
    
         
             
            homepage: https://github.com/carnivore-rb/carnivore-nsq
         
     | 
| 
       56 
56 
     | 
    
         
             
            licenses:
         
     | 
| 
       57 
57 
     | 
    
         
             
            - Apache 2.0
         
     | 
| 
       58 
58 
     | 
    
         
             
            metadata: {}
         
     | 
| 
       59 
     | 
    
         
            -
            post_install_message: 
     | 
| 
      
 59 
     | 
    
         
            +
            post_install_message:
         
     | 
| 
       60 
60 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       61 
61 
     | 
    
         
             
            require_paths:
         
     | 
| 
       62 
62 
     | 
    
         
             
            - lib
         
     | 
| 
       63 
63 
     | 
    
         
             
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
       64 
64 
     | 
    
         
             
              requirements:
         
     | 
| 
       65 
     | 
    
         
            -
              - -  
     | 
| 
      
 65 
     | 
    
         
            +
              - - '>='
         
     | 
| 
       66 
66 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       67 
67 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       68 
68 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       69 
69 
     | 
    
         
             
              requirements:
         
     | 
| 
       70 
     | 
    
         
            -
              - -  
     | 
| 
      
 70 
     | 
    
         
            +
              - - '>='
         
     | 
| 
       71 
71 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       72 
72 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       73 
73 
     | 
    
         
             
            requirements: []
         
     | 
| 
       74 
     | 
    
         
            -
            rubyforge_project: 
     | 
| 
       75 
     | 
    
         
            -
            rubygems_version: 2. 
     | 
| 
       76 
     | 
    
         
            -
            signing_key: 
     | 
| 
      
 74 
     | 
    
         
            +
            rubyforge_project:
         
     | 
| 
      
 75 
     | 
    
         
            +
            rubygems_version: 2.1.9
         
     | 
| 
      
 76 
     | 
    
         
            +
            signing_key:
         
     | 
| 
       77 
77 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       78 
78 
     | 
    
         
             
            summary: Message processing helper
         
     | 
| 
       79 
79 
     | 
    
         
             
            test_files: []
         
     | 
| 
       80 
     | 
    
         
            -
            has_rdoc: 
     | 
| 
      
 80 
     | 
    
         
            +
            has_rdoc:
         
     |