aws-activejob-sqs 0.1.0 → 0.1.1
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 +5 -0
- data/VERSION +1 -1
- data/lib/aws/active_job/sqs/executor.rb +21 -0
- data/lib/aws-activejob-sqs.rb +4 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1eeedcef79ed4252667f821bcd84cef11304edc53368206191e415a75c6d9f6e
|
4
|
+
data.tar.gz: 7478443ea1a47d862e217a9f5ce44b81cd8c96bfc9a6360b5c48b6681c71f39f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f61a2e9c1d5065feadde7833499909449cc1ce390569e5528fca0633315364b24dc27d87cee3a9b39d98b6081a7405e2537584a8713119df68db6b3b87d03e1f
|
7
|
+
data.tar.gz: a75662933ed22c33465d209fe95034a1c874b38fdcc50e595417d04f025b870a0e7054fdf007bd53e19c461519a193e6996c830e1d1654d7a34a8224f75a9530
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -15,6 +15,20 @@ module Aws
|
|
15
15
|
fallback_policy: :abort # Concurrent::RejectedExecutionError must be handled
|
16
16
|
}.freeze
|
17
17
|
|
18
|
+
class << self
|
19
|
+
def on_stop(&block)
|
20
|
+
lifecycle_hooks[:stop] << block
|
21
|
+
end
|
22
|
+
|
23
|
+
def lifecycle_hooks
|
24
|
+
@lifecycle_hooks ||= Hash.new { |h, k| h[k] = [] }
|
25
|
+
end
|
26
|
+
|
27
|
+
def clear_hooks
|
28
|
+
@lifecycle_hooks = nil
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
18
32
|
def initialize(options = {})
|
19
33
|
@executor = Concurrent::ThreadPoolExecutor.new(DEFAULTS.merge(options))
|
20
34
|
@retry_standard_errors = options[:retry_standard_errors]
|
@@ -32,6 +46,7 @@ module Aws
|
|
32
46
|
end
|
33
47
|
|
34
48
|
def shutdown(timeout = nil)
|
49
|
+
run_hooks_for(:stop)
|
35
50
|
@executor.shutdown
|
36
51
|
clean_shutdown = @executor.wait_for_termination(timeout)
|
37
52
|
if clean_shutdown
|
@@ -71,6 +86,12 @@ module Aws
|
|
71
86
|
@task_complete.set
|
72
87
|
end
|
73
88
|
end
|
89
|
+
|
90
|
+
def run_hooks_for(event_name)
|
91
|
+
return unless (hooks = self.class.lifecycle_hooks[event_name])
|
92
|
+
|
93
|
+
hooks.each(&:call)
|
94
|
+
end
|
74
95
|
end
|
75
96
|
end
|
76
97
|
end
|
data/lib/aws-activejob-sqs.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-activejob-sqs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-sqs
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '0'
|
101
101
|
requirements: []
|
102
|
-
rubygems_version: 3.5.
|
102
|
+
rubygems_version: 3.5.9
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
105
|
summary: ActiveJob integration with SQS
|