cuetip 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cuetip/version.rb +1 -1
- data/lib/cuetip/worker_group.rb +12 -9
- 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: 846dd406c3144f1548c2385b57854e02fc58a28c198557fbac1e5525390c4851
|
4
|
+
data.tar.gz: 4ccc211f14f69ebe8828ef6089bc5a4179672cdff7e8c91bf1199f30c9ab7893
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21def25a628be5d6698b8254093acc612fa68dc549a674e0b495f9c91dfcc82bb2d1bfa2a863830caf3009c8d41fd35724f66f1ec10a6c2a75d15a31688053f5
|
7
|
+
data.tar.gz: 073ad3cfca0e29f854df84bffbba65120302aa29ad6a2e3d0c258fa8c24ef648764e808f25e4bce9693a63016a8062a16c578606e40073b79df4283aba95af63
|
data/lib/cuetip/version.rb
CHANGED
data/lib/cuetip/worker_group.rb
CHANGED
@@ -6,6 +6,7 @@ module Cuetip
|
|
6
6
|
class WorkerGroup
|
7
7
|
include ActiveSupport::Callbacks
|
8
8
|
|
9
|
+
define_callbacks :run_worker_group
|
9
10
|
define_callbacks :run_worker
|
10
11
|
|
11
12
|
attr_reader :quantity
|
@@ -34,19 +35,21 @@ module Cuetip
|
|
34
35
|
trap('INT', &exit_trap)
|
35
36
|
trap('TERM', &exit_trap)
|
36
37
|
|
37
|
-
|
38
|
-
@
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
38
|
+
run_callbacks :run_worker_group do
|
39
|
+
@quantity.times do |i|
|
40
|
+
@workers[i] = Worker.new(self, i, @queues)
|
41
|
+
Klogger.tagged worker_index: i do
|
42
|
+
Cuetip.logger.info "Starting worker"
|
43
|
+
@threads[i] = Thread.new(@workers[i]) do |worker|
|
44
|
+
run_callbacks :run_worker do
|
45
|
+
worker.run
|
46
|
+
end
|
44
47
|
end
|
45
48
|
end
|
49
|
+
@threads[i].abort_on_exception = true
|
46
50
|
end
|
47
|
-
@threads
|
51
|
+
@threads.values.each(&:join)
|
48
52
|
end
|
49
|
-
@threads.values.each(&:join)
|
50
53
|
end
|
51
54
|
end
|
52
55
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cuetip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
|
-
rubygems_version: 3.
|
104
|
+
rubygems_version: 3.4.6
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: An ActiveRecord job queueing system
|