sqewer 6.0.0 → 6.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 265bbc0bc13eeef0b5e99b04c509d99464e7d236
4
- data.tar.gz: 48f95a807d92fc31956524b7ff07892851cf4369
3
+ metadata.gz: 1c919afcf26f8c9016c746e600f439b51e1cf256
4
+ data.tar.gz: defe9b65968719023eb08ceec4c9c5889e5ee775
5
5
  SHA512:
6
- metadata.gz: 6e6329fcbc8e9ba24adc4f98231a6875c94536de2d74c72fd3b670f3b0b04f27466e7776e3ce9d63cb7631f4ce82bc2143d40df96d4c3f5f3659ce5d6ae90b8c
7
- data.tar.gz: '0319a0135413668649e37b3f0ad449eff0d857d8e5cae912111385d02bc1fa5090e4f0749388eb8fb6d0fb8417fb78102022c05efaea0e87443700353eafbaf0'
6
+ metadata.gz: 34f003b295c0cff07fffac451fd66884b8c2e1d866ab00635e69e084480ab50e83c04684952a69f1ab927dc152f10eed029b0f8f1455741585233c956e61e1bb
7
+ data.tar.gz: eaf9a98c8d80261cc09ab33c02827c281cd30232ffd411af6a9d1707345d22c3283e19e394ea68314cf7a93a49bcb16e976fc9d4152891fab821b4bba8c33f82
data/CHANGELOG.md CHANGED
@@ -1,19 +1,25 @@
1
- ### 2017-06-16
2
- - Released v5.0.9 to Rubygems.org.
1
+ ### 6.0.1
2
+ - Fix an issue in the interaction between the Appsignal and Activejob extensions that caused all the background jobs to show up as instances of `ActiveJob::QueueAdapters::SqewerAdapter::Performable#run`.
3
+
4
+ ### 6.0.0
5
+ - Bump the supported AWS SDK to v3 and only require `aws-sdk-sqs` as a dependency. This reduces the amount of code Sqewer needs to load, as SQS is the only service we are actually using. This requires the hosting application to be updated to the SDK v3 as well.
6
+ - Reduce spurious test failures when testing the ActiveJob adapter
7
+
8
+ ### 5.1.1
9
+ - Add support for local SQLite-based queues, that can be used by starting the SQS_QUEUE_URL with `sqlite3:/`. This decouples sqewer from the AWS SDK and allows one to develop without needing the entire AWS stack or it's simulation environments such as fake_sqs. The SQLite database can be safely used across multiple processes.
10
+
11
+ ### 5.0.9
3
12
  - Testing with fake_sqs when the daemon was not running or with a misconfigured SQS_QUEUE_URL could lead to Sqewer seemingly hanging. The actual cause was a _very_ large amount of retries were being performed. The amount of retries has been adjusted to a more reasonable number.
4
13
  - An exception in the message fetching thread could lead to the receiving thread silently dying, while leaving the worker threads running without any work to do. Uncaught exceptions in the receiving thread now lead to a graceful shutdown of the worker.
5
14
 
6
- ### 2017-06-12
7
- - Released v5.0.8 to Rubygems.org.
15
+ ### 5.0.8
8
16
  - Retry sending and deleting messages when `sender_fault=false`.
9
17
 
10
- ### 2017-05-26
11
- - Released v5.0.7 to Rubygems.org.
18
+ ### 5.0.7
12
19
  - Report errors with string interpolation to avoid confusion.
13
20
  - Fix failure when running one test at a time.
14
21
 
15
- ### 2017-05-26
16
- - Released v5.0.6 to Rubygems.org.
22
+ ### 5.0.6
17
23
  - Additional change to error reporting: report errors both on submitting and on deleting messages.
18
24
 
19
25
  ### 2017-05-03
@@ -41,4 +47,4 @@
41
47
  - Improve Appsignal integration; only show parameters if the job actually supports those.
42
48
  - Simplify CLI tests and add tests with mock workers.
43
49
 
44
- ### Current end of changelog. For earlier changes see the commit log on github.
50
+ ### Current end of changelog. For earlier changes see the commit log on github.
@@ -1,8 +1,14 @@
1
1
  # ActiveJob docs: http://edgeguides.rubyonrails.org/active_job_basics.html
2
2
  # Example adapters ref: https://github.com/rails/rails/tree/master/activejob/lib/active_job/queue_adapters
3
3
  module ActiveJob
4
+ # Only prepend the module with keyword agrument acceptance when the version is 4
5
+ # ActiveJob 5.x supports kwargs out of the box
6
+ if ActiveJob::VERSION::MAJOR <= 4
7
+ module Execution
8
+ prepend PerformWithKeywords
9
+ end
10
+ end
4
11
  module QueueAdapters
5
-
6
12
  # Handle Rails ActiveJob through sqewer.
7
13
  # Set it up like so:
8
14
  #
@@ -35,6 +41,10 @@ module ActiveJob
35
41
  '<%s>' % [@job.inspect]
36
42
  end
37
43
 
44
+ def class_name
45
+ @job["job_class"]
46
+ end
47
+
38
48
  # Runs the contained ActiveJob.
39
49
  def run
40
50
  job = ActiveSupport::HashWithIndifferentAccess.new(@job)
@@ -72,7 +82,6 @@ module ActiveJob
72
82
  Sqewer.submit!(wrapped_job, delay_seconds: delta_t)
73
83
  end
74
84
  end
75
-
76
85
  end
77
86
  end
78
87
  end
@@ -59,7 +59,8 @@ module Sqewer
59
59
  end
60
60
 
61
61
  def set_transaction_details_from_job(transaction, job)
62
- transaction.set_action('%s#%s' % [job.class.to_s, 'run'])
62
+ job_class_string = job.is_a?(ActiveJob::QueueAdapters::SqewerAdapter::Performable) ? job.class_name : job.class.to_s
63
+ transaction.set_action('%s#%s' % [job_class_string, 'run'])
63
64
  job_params = job.respond_to?(:to_h) ? job.to_h : {}
64
65
  transaction.request.params = job_params
65
66
  end
@@ -0,0 +1,15 @@
1
+ # This module enables the acceptance of kwargs for the perform method inside
2
+ # of ActiveJob::Execution (only needed on ActiveJob versions < 5)
3
+ module PerformWithKeywords
4
+ def perform_now
5
+ deserialize_arguments_if_needed
6
+ run_callbacks :perform do
7
+ args_with_symbolized_options = arguments.map do |a|
8
+ a.respond_to?(:symbolize_keys) ? a.symbolize_keys : a
9
+ end
10
+ perform(*args_with_symbolized_options)
11
+ end
12
+ rescue => exception
13
+ rescue_with_handler(exception) || raise(exception)
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Sqewer
2
- VERSION = '6.0.0'
2
+ VERSION = '6.0.1'
3
3
  end
data/sqewer.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'sqewer/version'
4
+ require "sqewer/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "sqewer"
@@ -13,10 +13,10 @@ Gem::Specification.new do |spec|
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
15
 
16
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the "allowed_push_host"
17
17
  # to allow pushing to a single host or delete this section to allow pushing to any host.
18
18
  if spec.respond_to?(:metadata)
19
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
19
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
20
20
  else
21
21
  raise "RubyGems 2.0 or newer is required to protect against " \
22
22
  "public gem pushes."
@@ -29,14 +29,14 @@ Gem::Specification.new do |spec|
29
29
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ["lib"]
31
31
 
32
- spec.add_runtime_dependency 'aws-sdk-sqs', '~> 1'
33
- spec.add_runtime_dependency 'rack'
34
- spec.add_runtime_dependency 'very_tiny_state_machine'
35
- spec.add_runtime_dependency 'ks'
36
- spec.add_runtime_dependency 'retriable'
32
+ spec.add_runtime_dependency "aws-sdk-sqs", "1.3.0"
33
+ spec.add_runtime_dependency "rack"
34
+ spec.add_runtime_dependency "very_tiny_state_machine"
35
+ spec.add_runtime_dependency "ks"
36
+ spec.add_runtime_dependency "retriable"
37
37
 
38
38
  spec.add_development_dependency "bundler", "~> 1"
39
- spec.add_development_dependency "rake", "~> 10.0"
39
+ spec.add_development_dependency "rake", "~> 12.3"
40
40
  spec.add_development_dependency "rspec", "~> 3.0"
41
41
  spec.add_development_dependency "activejob", "~> 4.2.6"
42
42
  spec.add_development_dependency "rspec-wait"
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0
4
+ version: 6.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-08 00:00:00.000000000 Z
11
+ date: 2018-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sqs
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '1'
19
+ version: 1.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '1'
26
+ version: 1.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rack
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '10.0'
103
+ version: '12.3'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '10.0'
110
+ version: '12.3'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -238,6 +238,7 @@ files:
238
238
  - lib/sqewer/local_connection.rb
239
239
  - lib/sqewer/middleware_stack.rb
240
240
  - lib/sqewer/null_logger.rb
241
+ - lib/sqewer/perform_override.rb
241
242
  - lib/sqewer/resubmit.rb
242
243
  - lib/sqewer/serializer.rb
243
244
  - lib/sqewer/simple_job.rb
@@ -266,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
266
267
  version: '0'
267
268
  requirements: []
268
269
  rubyforge_project:
269
- rubygems_version: 2.6.11
270
+ rubygems_version: 2.4.5
270
271
  signing_key:
271
272
  specification_version: 4
272
273
  summary: Process jobs from SQS