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 +4 -4
- data/lib/toiler/actor/fetcher.rb +7 -1
- data/lib/toiler/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5504e750169f69b4c69765d2a10fb12d75be14e6
|
4
|
+
data.tar.gz: 19b42321741daecb973be680aa7c9dfff1bea16d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebe752489306898d99582a0f7107fe28627528f3ad8384f59825496ed7587856c3f776df07e539a548b2b3919be25343e139ca0f1598d5e72d065bb6ad3cb4f0
|
7
|
+
data.tar.gz: bfd383932c9f947ef99db9480f6d677d69b80bdd5e90959fdc95cecb036f3b9bfcbae162d798eb84a8af1f67fa22b8f331d280e36da45307e3d579bf6dc54417
|
data/lib/toiler/actor/fetcher.rb
CHANGED
@@ -68,7 +68,7 @@ module Toiler
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def poll_messages
|
71
|
-
return unless
|
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
|
data/lib/toiler/version.rb
CHANGED