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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8269ab5e82cdf7e548c1975a9963f9cedf5f0b7f
4
- data.tar.gz: 89755af2b57f2a515b2143fb685663788b3dc945
3
+ metadata.gz: 18b3baca77e6c629bfbfecde318e56fa015a812f
4
+ data.tar.gz: b26dfad2d88870aec9deb0b6f6ecfceb53b19f8f
5
5
  SHA512:
6
- metadata.gz: 54241bbbef36d613e5325db3bda0a43a3f6ce661288cdb05b10f3ab347a929998877042cca729794152b23dad375f83afc183c348a47d1eebacb8373a6bba2b1
7
- data.tar.gz: 9c42b989d33bd60280f151c52639e8b81305fb406a0664f8d775cff778c93e1c83c2c3f9fd599775e446f9185b81411e8ed991852e6b4a7227080e0d86424d61
6
+ metadata.gz: a70e9d2135be63ced0612c4f6ecc473cf5584d53cbc244fd15d3a0f5798956cd9446668ed75b2590d790cba20e61080011eb047ac7cdce443970376443888922
7
+ data.tar.gz: a08d9df9bb0cdef9617ac69158d9580019718638beaf56a68383b25502c708957a721f1349e6b7fbf0e2691738351c44264d5fde19c7b142ba3c889e5a64a769
@@ -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
 
@@ -1,4 +1,4 @@
1
1
  # Toiler Version
2
2
  module Toiler
3
- VERSION = '0.5.1.pre5'.freeze
3
+ VERSION = '0.5.1.pre6'.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.pre5
4
+ version: 0.5.1.pre6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Schepens