sqewer 6.5.1 → 7.0.0
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/.travis.yml +0 -16
- data/CHANGELOG.md +5 -0
- data/README.md +2 -2
- data/bin/console +8 -0
- data/lib/sqewer.rb +19 -0
- data/lib/sqewer/connection.rb +5 -0
- data/lib/sqewer/version.rb +1 -1
- data/sqewer.gemspec +1 -0
- metadata +9 -8
- data/gemfiles/Gemfile.rails-4.2.x +0 -8
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: acb88799499e49e2390422fd05b7c7a160bfec1f441347947941a8f15f62e3f1
         | 
| 4 | 
            +
              data.tar.gz: d009682a2cf36c0a27daf683b6110a1a0ce6b3f1b35ba111ad391d57281aa4d1
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 262f94efde1b86cbce03be08ce9a9c4cdd11de0bb95354c1f7a0adc29bdd4dc08c5d3d82d3377c5d9825dde7bbe1a7323214ed6d89c82d4ed97a56ffd27e0f98
         | 
| 7 | 
            +
              data.tar.gz: 5375e768f53ad132fd5a6460dbe5bbf6b1457eaa514c54a1d445fb0f9b7ac30a4c852157877894766ae69da82c2e4efb76c42c4a0689f759ee9b83d909869752
         | 
    
        data/.travis.yml
    CHANGED
    
    | @@ -1,11 +1,7 @@ | |
| 1 1 | 
             
            gemfile:
         | 
| 2 | 
            -
              - gemfiles/Gemfile.rails-4.2.x
         | 
| 3 2 | 
             
              - gemfiles/Gemfile.rails-5.0.x
         | 
| 4 3 | 
             
              - gemfiles/Gemfile.rails-5.1.x
         | 
| 5 4 | 
             
            rvm:
         | 
| 6 | 
            -
              - 2.3.7
         | 
| 7 | 
            -
              - 2.4.5
         | 
| 8 | 
            -
              - 2.5.1
         | 
| 9 5 | 
             
              - 2.6.5
         | 
| 10 6 | 
             
              - 2.7.0
         | 
| 11 7 | 
             
            cache: bundler
         | 
| @@ -13,15 +9,3 @@ sudo: false | |
| 13 9 | 
             
            env:
         | 
| 14 10 | 
             
              global:
         | 
| 15 11 | 
             
              - AWS_REGION=eu-central-1
         | 
| 16 | 
            -
            matrix:
         | 
| 17 | 
            -
              exclude:
         | 
| 18 | 
            -
              - rvm: 2.3.7
         | 
| 19 | 
            -
                gemfile: gemfiles/Gemfile.rails-5.0.x
         | 
| 20 | 
            -
              - rvm: 2.3.7
         | 
| 21 | 
            -
                gemfile: gemfiles/Gemfile.rails-5.1.x
         | 
| 22 | 
            -
              - rvm: 2.5.1
         | 
| 23 | 
            -
                gemfile: gemfiles/Gemfile.rails-4.2.x
         | 
| 24 | 
            -
              - rvm: 2.6.5
         | 
| 25 | 
            -
                gemfile: gemfiles/Gemfile.rails-4.2.x
         | 
| 26 | 
            -
              - rvm: 2.7.0
         | 
| 27 | 
            -
                gemfile: gemfiles/Gemfile.rails-4.2.x
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,3 +1,8 @@ | |
| 1 | 
            +
            ### 7.0.0
         | 
| 2 | 
            +
            - Remove support of Ruby 2.3, 2.4 and 2.5
         | 
| 3 | 
            +
            - Remove support of Rails 4
         | 
| 4 | 
            +
            - Change `Sqewer::Connection` to preferentially use a singleton instance of `Aws::SQS::Client`, which can be set using `Sqewer.client=`. This avoids many HTTP requests to the AWS metadata endpoint when getting credentials.
         | 
| 5 | 
            +
             | 
| 1 6 | 
             
            ### 6.5.1
         | 
| 2 7 | 
             
            - Also retry on `Aws::SQS::Errors::InternalError` exception when receiving/sending messages. This will make
         | 
| 3 8 | 
             
              the receiving thread more resilient to sudden SQS failures. By the time SQS recovers the receiving thread
         | 
    
        data/README.md
    CHANGED
    
    | @@ -48,7 +48,7 @@ The messages will only be deleted from SQS once the job execution completes with | |
| 48 48 |  | 
| 49 49 | 
             
            ## Requirements
         | 
| 50 50 |  | 
| 51 | 
            -
            Ruby 2. | 
| 51 | 
            +
            Ruby 2.6+, version 2 of the AWS SDK. You can also run Sqewer backed by a SQLite database file, which can be handy for development situations.
         | 
| 52 52 |  | 
| 53 53 | 
             
            ## Job storage
         | 
| 54 54 |  | 
| @@ -288,7 +288,7 @@ and traceable (make good use of logging). | |
| 288 288 |  | 
| 289 289 | 
             
            # Usage with Rails via ActiveJob
         | 
| 290 290 |  | 
| 291 | 
            -
            This gem includes a queue adapter for usage with ActiveJob in Rails  | 
| 291 | 
            +
            This gem includes a queue adapter for usage with ActiveJob in Rails 5+. The functionality
         | 
| 292 292 | 
             
            is well-tested and should function for any well-conforming ActiveJob subclasses.
         | 
| 293 293 |  | 
| 294 294 | 
             
            To run the default `sqewer` worker setup against your Rails application, first set it as the
         | 
    
        data/bin/console
    ADDED
    
    
    
        data/lib/sqewer.rb
    CHANGED
    
    | @@ -11,6 +11,25 @@ module Sqewer | |
| 11 11 | 
             
                end
         | 
| 12 12 | 
             
              end
         | 
| 13 13 |  | 
| 14 | 
            +
              # Sets an instance of Aws::SQS::Client to be used as a singleton.
         | 
| 15 | 
            +
              # We recommend setting the options instance_profile_credentials_timeout and
         | 
| 16 | 
            +
              # instance_profile_credentials_retries, for example:
         | 
| 17 | 
            +
              #
         | 
| 18 | 
            +
              #   sqs_client = Aws::SQS::Client.new(
         | 
| 19 | 
            +
              #     instance_profile_credentials_timeout: 1,
         | 
| 20 | 
            +
              #     instance_profile_credentials_retries: 5,
         | 
| 21 | 
            +
              #   )
         | 
| 22 | 
            +
              #   Storm.client = sqs_client
         | 
| 23 | 
            +
              #
         | 
| 24 | 
            +
              # @param client[Aws::SQS::Client] an instance of Aws::SQS::Client
         | 
| 25 | 
            +
              def self.client=(client)
         | 
| 26 | 
            +
                @client = client
         | 
| 27 | 
            +
              end
         | 
| 28 | 
            +
             | 
| 29 | 
            +
              def self.client
         | 
| 30 | 
            +
                @client
         | 
| 31 | 
            +
              end
         | 
| 32 | 
            +
             | 
| 14 33 | 
             
              # Loads a particular Sqewer extension that is not loaded
         | 
| 15 34 | 
             
              # automatically during the gem require.
         | 
| 16 35 | 
             
              #
         | 
    
        data/lib/sqewer/connection.rb
    CHANGED
    
    | @@ -211,6 +211,11 @@ class Sqewer::Connection | |
| 211 211 | 
             
              end
         | 
| 212 212 |  | 
| 213 213 | 
             
              def client
         | 
| 214 | 
            +
                # It's better using a singleton client to prevent making a lot of HTTP
         | 
| 215 | 
            +
                # requests to the AWS metadata endpoint when getting credentials.
         | 
| 216 | 
            +
                # Maybe in the future, we can remove @client and use Storm.client only.
         | 
| 217 | 
            +
                return Sqewer.client if Sqewer.client
         | 
| 218 | 
            +
             | 
| 214 219 | 
             
                @client ||= Aws::SQS::Client.new(
         | 
| 215 220 | 
             
                  instance_profile_credentials_timeout: 1, # defaults to 1 second
         | 
| 216 221 | 
             
                  instance_profile_credentials_retries: 5, # defaults to 0 retries
         | 
    
        data/lib/sqewer/version.rb
    CHANGED
    
    
    
        data/sqewer.gemspec
    CHANGED
    
    | @@ -12,6 +12,7 @@ Gem::Specification.new do |spec| | |
| 12 12 | 
             
              spec.summary       = %q{Process jobs from SQS}
         | 
| 13 13 | 
             
              spec.description   = %q{A full-featured library for all them SQS worker needs}
         | 
| 14 14 | 
             
              spec.homepage      = "https://github.com/WeTransfer/sqewer"
         | 
| 15 | 
            +
              spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
         | 
| 15 16 |  | 
| 16 17 | 
             
              # Prevent pushing this gem to RubyGems.org. To allow pushes either set the "allowed_push_host"
         | 
| 17 18 | 
             
              # to allow pushing to a single host or delete this section to allow pushing to any host.
         | 
    
        metadata
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: sqewer
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version:  | 
| 4 | 
            +
              version: 7.0.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Julik Tarkhanov
         | 
| 8 8 | 
             
            - Andrei Horak
         | 
| 9 | 
            -
            autorequire: | 
| 9 | 
            +
            autorequire:
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2021- | 
| 12 | 
            +
            date: 2021-04-08 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: aws-sdk-sqs
         | 
| @@ -226,6 +226,7 @@ email: | |
| 226 226 | 
             
            - me@julik.nl
         | 
| 227 227 | 
             
            - linkyndy@gmail.com
         | 
| 228 228 | 
             
            executables:
         | 
| 229 | 
            +
            - console
         | 
| 229 230 | 
             
            - sqewer
         | 
| 230 231 | 
             
            - sqewer_rails
         | 
| 231 232 | 
             
            extensions: []
         | 
| @@ -239,10 +240,10 @@ files: | |
| 239 240 | 
             
            - Gemfile
         | 
| 240 241 | 
             
            - README.md
         | 
| 241 242 | 
             
            - Rakefile
         | 
| 243 | 
            +
            - bin/console
         | 
| 242 244 | 
             
            - bin/sqewer
         | 
| 243 245 | 
             
            - bin/sqewer_rails
         | 
| 244 246 | 
             
            - example.env
         | 
| 245 | 
            -
            - gemfiles/Gemfile.rails-4.2.x
         | 
| 246 247 | 
             
            - gemfiles/Gemfile.rails-5.0.x
         | 
| 247 248 | 
             
            - gemfiles/Gemfile.rails-5.1.x
         | 
| 248 249 | 
             
            - lib/sqewer.rb
         | 
| @@ -270,7 +271,7 @@ homepage: https://github.com/WeTransfer/sqewer | |
| 270 271 | 
             
            licenses: []
         | 
| 271 272 | 
             
            metadata:
         | 
| 272 273 | 
             
              allowed_push_host: https://rubygems.org
         | 
| 273 | 
            -
            post_install_message: | 
| 274 | 
            +
            post_install_message:
         | 
| 274 275 | 
             
            rdoc_options: []
         | 
| 275 276 | 
             
            require_paths:
         | 
| 276 277 | 
             
            - lib
         | 
| @@ -278,15 +279,15 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 278 279 | 
             
              requirements:
         | 
| 279 280 | 
             
              - - ">="
         | 
| 280 281 | 
             
                - !ruby/object:Gem::Version
         | 
| 281 | 
            -
                  version:  | 
| 282 | 
            +
                  version: 2.6.0
         | 
| 282 283 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 283 284 | 
             
              requirements:
         | 
| 284 285 | 
             
              - - ">="
         | 
| 285 286 | 
             
                - !ruby/object:Gem::Version
         | 
| 286 287 | 
             
                  version: '0'
         | 
| 287 288 | 
             
            requirements: []
         | 
| 288 | 
            -
            rubygems_version: 3.0. | 
| 289 | 
            -
            signing_key: | 
| 289 | 
            +
            rubygems_version: 3.0.3
         | 
| 290 | 
            +
            signing_key:
         | 
| 290 291 | 
             
            specification_version: 4
         | 
| 291 292 | 
             
            summary: Process jobs from SQS
         | 
| 292 293 | 
             
            test_files: []
         |