toiler 0.5.1.pre5 → 0.5.1.pre6
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 +6 -0
- 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: 18b3baca77e6c629bfbfecde318e56fa015a812f
|
4
|
+
data.tar.gz: b26dfad2d88870aec9deb0b6f6ecfceb53b19f8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a70e9d2135be63ced0612c4f6ecc473cf5584d53cbc244fd15d3a0f5798956cd9446668ed75b2590d790cba20e61080011eb047ac7cdce443970376443888922
|
7
|
+
data.tar.gz: a08d9df9bb0cdef9617ac69158d9580019718638beaf56a68383b25502c708957a721f1349e6b7fbf0e2691738351c44264d5fde19c7b142ba3c889e5a64a769
|
data/lib/toiler/actor/fetcher.rb
CHANGED
@@ -67,6 +67,10 @@ module Toiler
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
+
def release_messages(messages)
|
71
|
+
@waiting_messages -= messages
|
72
|
+
end
|
73
|
+
|
70
74
|
def poll_messages
|
71
75
|
return unless should_poll?
|
72
76
|
|
@@ -76,10 +80,12 @@ module Toiler
|
|
76
80
|
debug "Fetcher #{queue.name} polling messages..."
|
77
81
|
future = poll_future max_number_of_messages
|
78
82
|
future.on_rejection! do
|
83
|
+
tell [:release_messages, max_number_of_messages]
|
79
84
|
tell :poll_messages
|
80
85
|
end
|
81
86
|
future.on_fulfillment! do |msgs|
|
82
87
|
tell [:assign_messages, msgs] if !msgs.nil? && !msgs.empty?
|
88
|
+
tell [:release_messages, max_number_of_messages]
|
83
89
|
tell :poll_messages
|
84
90
|
end
|
85
91
|
|
data/lib/toiler/version.rb
CHANGED