toiler 0.5.1.pre3 → 0.5.1.pre4

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: be8f19b44e28f5f045972b38a671c90b1d175422
4
- data.tar.gz: be6ddac8af2f2578b2862bf48848e43a1b0ce861
3
+ metadata.gz: 5504e750169f69b4c69765d2a10fb12d75be14e6
4
+ data.tar.gz: 19b42321741daecb973be680aa7c9dfff1bea16d
5
5
  SHA512:
6
- metadata.gz: 0e7821f4c9ffae2b446b342da11b0fc39cbce2eff6d9acebc3f91c9a1103a9f06dd596f04eb5b31ea6a57e5ebac2f1a537a2e145e5dceb7617ebac6448c59243
7
- data.tar.gz: b402477a85d017099c6203b2a4d3d5fa539ca5a5f9d2aa05a3bd8027bcf85ccf242cab26058443f010cf37ad5711d46b374e6026177435394b46ebd5bd278602
6
+ metadata.gz: ebe752489306898d99582a0f7107fe28627528f3ad8384f59825496ed7587856c3f776df07e539a548b2b3919be25343e139ca0f1598d5e72d065bb6ad3cb4f0
7
+ data.tar.gz: bfd383932c9f947ef99db9480f6d677d69b80bdd5e90959fdc95cecb036f3b9bfcbae162d798eb84a8af1f67fa22b8f331d280e36da45307e3d579bf6dc54417
@@ -68,7 +68,7 @@ module Toiler
68
68
  end
69
69
 
70
70
  def poll_messages
71
- return unless free_processors / 2 > waiting_messages
71
+ return unless should_poll?
72
72
 
73
73
  max_number_of_messages = max_messages
74
74
  @waiting_messages += max_number_of_messages
@@ -82,6 +82,12 @@ module Toiler
82
82
  tell [:assign_messages, msgs] if !msgs.nil? && !msgs.empty?
83
83
  tell :poll_messages
84
84
  end
85
+
86
+ tell :poll_messages if should_poll?
87
+ end
88
+
89
+ def should_poll?
90
+ free_processors / 2 > waiting_messages
85
91
  end
86
92
 
87
93
  def processor_pool
@@ -1,4 +1,4 @@
1
1
  # Toiler Version
2
2
  module Toiler
3
- VERSION = '0.5.1.pre3'.freeze
3
+ VERSION = '0.5.1.pre4'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1.pre3
4
+ version: 0.5.1.pre4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Schepens