sqrewdriver 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 502c4b11e87ca48df0966e2638a89dcb7295efa9399e4953e039345165e550b3
4
- data.tar.gz: 6522640879f24a8422dc4e50fe778333bdd0a9d1c74f815932c5446b67cb96f3
3
+ metadata.gz: 0b748967fb6adeaf9638212f6b9eff580fea733dc13fbc65b986a8c24e8398f2
4
+ data.tar.gz: 826499d1159407832bde775edae2e08c82123032aa55c76724448f378d253a07
5
5
  SHA512:
6
- metadata.gz: 0c67020f0209e9045497c93e7e023c03df693e55c0a7a40a1785e42e294ae1a025631cbd0981d4ec64a03fd1fb6341bdd676ae0d2a9927b15afcfe1e946a6174
7
- data.tar.gz: 866c67be25a34ae3a39fb76971bdf4f2e15f313a13a3535e50f05ef682f11d488b94c9d95180fb7dd4bd95ab6f031c35056a1aa27a022a9bf2f21b602fc4316b
6
+ metadata.gz: 41511bfb40eb0c09902de755d4b996dc94f1d0014cbe17535539987baae2cb198964868ab86913886fbc0f637897dcd6d1e4e0e4095a55effe3d42dd19c90ce3
7
+ data.tar.gz: ab41ab5d2a472efac4e220a21ba8bce486aa4476e92c02c648fbf410f14ed496b8656ba5d90fab0f4d0c8407d40a3d94bde87854ebe23b49843a23dad9fb796d
@@ -1,42 +1,43 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sqrewdriver (0.1.1)
4
+ sqrewdriver (0.1.2)
5
5
  aws-sdk-sqs
6
6
  concurrent-ruby
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- aws-eventstream (1.0.1)
12
- aws-partitions (1.141.0)
13
- aws-sdk-core (3.46.2)
14
- aws-eventstream (~> 1.0)
15
- aws-partitions (~> 1.0)
16
- aws-sigv4 (~> 1.0)
11
+ aws-eventstream (1.1.0)
12
+ aws-partitions (1.319.0)
13
+ aws-sdk-core (3.96.1)
14
+ aws-eventstream (~> 1, >= 1.0.2)
15
+ aws-partitions (~> 1, >= 1.239.0)
16
+ aws-sigv4 (~> 1.1)
17
17
  jmespath (~> 1.0)
18
- aws-sdk-sqs (1.10.0)
19
- aws-sdk-core (~> 3, >= 3.39.0)
20
- aws-sigv4 (~> 1.0)
21
- aws-sigv4 (1.0.3)
22
- concurrent-ruby (1.1.4)
18
+ aws-sdk-sqs (1.25.0)
19
+ aws-sdk-core (~> 3, >= 3.71.0)
20
+ aws-sigv4 (~> 1.1)
21
+ aws-sigv4 (1.1.3)
22
+ aws-eventstream (~> 1.0, >= 1.0.2)
23
+ concurrent-ruby (1.1.6)
23
24
  diff-lcs (1.3)
24
25
  jmespath (1.4.0)
25
- oj (3.7.9)
26
- rake (10.5.0)
27
- rspec (3.8.0)
28
- rspec-core (~> 3.8.0)
29
- rspec-expectations (~> 3.8.0)
30
- rspec-mocks (~> 3.8.0)
31
- rspec-core (3.8.0)
32
- rspec-support (~> 3.8.0)
33
- rspec-expectations (3.8.2)
26
+ oj (3.10.6)
27
+ rake (13.0.1)
28
+ rspec (3.9.0)
29
+ rspec-core (~> 3.9.0)
30
+ rspec-expectations (~> 3.9.0)
31
+ rspec-mocks (~> 3.9.0)
32
+ rspec-core (3.9.2)
33
+ rspec-support (~> 3.9.3)
34
+ rspec-expectations (3.9.2)
34
35
  diff-lcs (>= 1.2.0, < 2.0)
35
- rspec-support (~> 3.8.0)
36
- rspec-mocks (3.8.0)
36
+ rspec-support (~> 3.9.0)
37
+ rspec-mocks (3.9.1)
37
38
  diff-lcs (>= 1.2.0, < 2.0)
38
- rspec-support (~> 3.8.0)
39
- rspec-support (3.8.0)
39
+ rspec-support (~> 3.9.0)
40
+ rspec-support (3.9.3)
40
41
 
41
42
  PLATFORMS
42
43
  ruby
@@ -44,9 +45,9 @@ PLATFORMS
44
45
  DEPENDENCIES
45
46
  bundler (~> 2.0)
46
47
  oj
47
- rake (~> 10.0)
48
+ rake (~> 13.0)
48
49
  rspec (~> 3.0)
49
50
  sqrewdriver!
50
51
 
51
52
  BUNDLED WITH
52
- 2.0.1
53
+ 2.1.4
@@ -34,8 +34,8 @@ module Sqrewdriver
34
34
  # If count of buffered messages exceed 10 or aggregate_messages_per
35
35
  # else if sum of message size exceeds 256KB,
36
36
  # send payload to SQS asynchronously.
37
- def send_message_buffered(queue_url: nil, **params)
38
- add_message_to_buffer(params)
37
+ def send_message_buffered(message)
38
+ add_message_to_buffer(message)
39
39
 
40
40
  if need_flush?
41
41
  flush_async
@@ -117,7 +117,7 @@ module Sqrewdriver
117
117
 
118
118
  def send_first_chunk_async
119
119
  Concurrent::Promises.future_on(@thread_pool, @chunks) do |chunks|
120
- sending = chunks.shift
120
+ sending = synchronize { chunks.shift }
121
121
  if sending
122
122
  sending.data.each_with_index do |params, idx|
123
123
  params[:id] = idx.to_s
@@ -190,8 +190,8 @@ module Sqrewdriver
190
190
 
191
191
  private
192
192
 
193
- def add_message_to_buffer(params)
194
- @message_buffer << params
193
+ def add_message_to_buffer(message)
194
+ @message_buffer << message
195
195
  end
196
196
 
197
197
  def need_flush?
@@ -199,7 +199,7 @@ module Sqrewdriver
199
199
  end
200
200
 
201
201
  def send_first_chunk_async
202
- future = @sending_buffer.send_first_chunk_async
202
+ future = @sending_buffer.send_first_chunk_async
203
203
  @waiting_futures << future
204
204
  future.on_resolution_using(@thread_pool) do |fulfilled, value, reason|
205
205
  @waiting_futures.delete(future)
@@ -3,12 +3,16 @@ module Sqrewdriver
3
3
  attr :errors
4
4
 
5
5
  def initialize(errors)
6
- @errors = errors
6
+ @errors = Array(errors).compact
7
7
  end
8
8
 
9
9
  def messages
10
10
  @errors.map(&:message)
11
11
  end
12
+
13
+ def to_s
14
+ errors.map(&:inspect).join(", ")
15
+ end
12
16
  end
13
17
 
14
18
  class SendMessageBatchFailure < StandardError
@@ -1,3 +1,3 @@
1
1
  module Sqrewdriver
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -26,6 +26,6 @@ Gem::Specification.new do |spec|
26
26
  spec.add_runtime_dependency "concurrent-ruby"
27
27
 
28
28
  spec.add_development_dependency "bundler", "~> 2.0"
29
- spec.add_development_dependency "rake", "~> 10.0"
29
+ spec.add_development_dependency "rake", "~> 13.0"
30
30
  spec.add_development_dependency "rspec", "~> 3.0"
31
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqrewdriver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - joker1007
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-08 00:00:00.000000000 Z
11
+ date: 2020-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-sqs
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '13.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '13.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubygems_version: 3.0.3
126
+ rubygems_version: 3.1.2
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: This gem extend Amazon SQS client. (parallelize and aggregation)