tax_generator 0.0.8 → 0.0.9
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ee59dab7c5f252ce53af0631c0f524cc556fd63
|
4
|
+
data.tar.gz: 1871bb330fa3f1cc71f46551e1c1e9b921a90477
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8779ec7aa3fe87755da1514e7d2907e426e6bfef860ad8e3787b87421f113ac9f7820c675185a31e4f05f6a3f4d6357e9c933265ae1f36501e2181c0b6552f5
|
7
|
+
data.tar.gz: 353c8746666c5ecd3055f54f49203ab92e5652a13e7e50f53af2137d9980ed954e17d80c89fbc39950067b7a5ed997d2c2623b9351a7f3cebd94a542881c8ff0
|
@@ -82,8 +82,6 @@ module TaxGenerator
|
|
82
82
|
# @api public
|
83
83
|
def mark_job_completed
|
84
84
|
@processor.jobs[@job_id]['status'] = 'finished'
|
85
|
-
return if !@processor.alive? || !@processor.all_workers_finished?
|
86
|
-
@processor.condition.signal('completed')
|
87
85
|
end
|
88
86
|
|
89
87
|
# fetches the details needed to be passed to the erb template
|
@@ -17,15 +17,13 @@ module TaxGenerator
|
|
17
17
|
# @return [Hash] each key from the list is the job id, and the value is the worker that will handle the job
|
18
18
|
# @!attribute worker_to_job
|
19
19
|
# @return [Hash] each key from the list is the workers mailbox address, and the value is the job being handled by the worker
|
20
|
-
# @!attribute condition
|
21
|
-
# @return [Celluloid::Condition] the supervision group that supervises workers
|
22
20
|
class Processor
|
23
21
|
include Celluloid
|
24
22
|
include Celluloid::Logger
|
25
23
|
include Celluloid::Notifications
|
26
24
|
include TaxGenerator::ApplicationHelper
|
27
25
|
|
28
|
-
attr_reader :options, :worker_supervisor, :workers, :taxonomy, :jobs, :job_to_worker, :worker_to_job
|
26
|
+
attr_reader :options, :worker_supervisor, :workers, :taxonomy, :jobs, :job_to_worker, :worker_to_job
|
29
27
|
|
30
28
|
trap_exit :worker_died
|
31
29
|
|
@@ -51,7 +49,6 @@ module TaxGenerator
|
|
51
49
|
@jobs = {}
|
52
50
|
@job_to_worker = {}
|
53
51
|
@worker_to_job = {}
|
54
|
-
@condition = Celluloid::Condition.new
|
55
52
|
end
|
56
53
|
|
57
54
|
# returns the input folder from the options list
|
@@ -210,9 +207,8 @@ module TaxGenerator
|
|
210
207
|
#
|
211
208
|
# @api public
|
212
209
|
def wait_jobs_termination
|
213
|
-
|
214
|
-
|
215
|
-
terminate if all_workers_finished?
|
210
|
+
sleep(0.1) until all_workers_finished?
|
211
|
+
terminate
|
216
212
|
end
|
217
213
|
|
218
214
|
# registers the worker so that the current actor has access to it at any given time and starts the worker
|