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 +4 -4
- data/Gemfile.lock +28 -27
- data/lib/sqrewdriver/client.rb +6 -6
- data/lib/sqrewdriver/errors.rb +5 -1
- data/lib/sqrewdriver/version.rb +1 -1
- data/sqrewdriver.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b748967fb6adeaf9638212f6b9eff580fea733dc13fbc65b986a8c24e8398f2
|
4
|
+
data.tar.gz: 826499d1159407832bde775edae2e08c82123032aa55c76724448f378d253a07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41511bfb40eb0c09902de755d4b996dc94f1d0014cbe17535539987baae2cb198964868ab86913886fbc0f637897dcd6d1e4e0e4095a55effe3d42dd19c90ce3
|
7
|
+
data.tar.gz: ab41ab5d2a472efac4e220a21ba8bce486aa4476e92c02c648fbf410f14ed496b8656ba5d90fab0f4d0c8407d40a3d94bde87854ebe23b49843a23dad9fb796d
|
data/Gemfile.lock
CHANGED
@@ -1,42 +1,43 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sqrewdriver (0.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
|
12
|
-
aws-partitions (1.
|
13
|
-
aws-sdk-core (3.
|
14
|
-
aws-eventstream (~> 1.0)
|
15
|
-
aws-partitions (~> 1.0)
|
16
|
-
aws-sigv4 (~> 1.
|
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.
|
19
|
-
aws-sdk-core (~> 3, >= 3.
|
20
|
-
aws-sigv4 (~> 1.
|
21
|
-
aws-sigv4 (1.
|
22
|
-
|
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.
|
26
|
-
rake (
|
27
|
-
rspec (3.
|
28
|
-
rspec-core (~> 3.
|
29
|
-
rspec-expectations (~> 3.
|
30
|
-
rspec-mocks (~> 3.
|
31
|
-
rspec-core (3.
|
32
|
-
rspec-support (~> 3.
|
33
|
-
rspec-expectations (3.
|
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.
|
36
|
-
rspec-mocks (3.
|
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.
|
39
|
-
rspec-support (3.
|
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 (~>
|
48
|
+
rake (~> 13.0)
|
48
49
|
rspec (~> 3.0)
|
49
50
|
sqrewdriver!
|
50
51
|
|
51
52
|
BUNDLED WITH
|
52
|
-
2.
|
53
|
+
2.1.4
|
data/lib/sqrewdriver/client.rb
CHANGED
@@ -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(
|
38
|
-
add_message_to_buffer(
|
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(
|
194
|
-
@message_buffer <<
|
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)
|
data/lib/sqrewdriver/errors.rb
CHANGED
@@ -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
|
data/lib/sqrewdriver/version.rb
CHANGED
data/sqrewdriver.gemspec
CHANGED
@@ -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", "~>
|
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.
|
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:
|
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: '
|
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: '
|
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.
|
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)
|