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: 0e429dc730d08412a3cfc1722c7a3a34a040f10d
4
- data.tar.gz: 1524eab039942a1289af54266369805d26203744
3
+ metadata.gz: 4ee59dab7c5f252ce53af0631c0f524cc556fd63
4
+ data.tar.gz: 1871bb330fa3f1cc71f46551e1c1e9b921a90477
5
5
  SHA512:
6
- metadata.gz: 7f01aeff0e8c4bfac118deb05e42b8f02d370c30697a24e613fb847f43a8523f9e0d727b6ac2123b637cb099d1e7a682d8ce0efc867be82e843d4c3713e1a60b
7
- data.tar.gz: 170a43c99f43eb00e6fa5952d973ceb3d6eac4ea0e7c0054fa6c549a5a30e95087e789e625e0e9b23b337dbc1124a0341a4bcaa17f0f6cf2151caf4cb45657f0
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, :condition
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
- result = @condition.wait
214
- return unless result.present?
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
@@ -17,7 +17,7 @@ module TaxGenerator
17
17
  # minor release version
18
18
  MINOR = 0
19
19
  # tiny release version
20
- TINY = 8
20
+ TINY = 9
21
21
  # prelease version ( set this only if it is a prelease)
22
22
  PRE = nil
23
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tax_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - bogdanRada