superbolt-future 0.1.2 → 0.1.3

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: 2cf2ed2ff4f5220516b04ce8edf11e6a5ef7e95b
4
- data.tar.gz: f4dc034ca50a01e968979cc615257c7ab0acb71d
3
+ metadata.gz: 13ea5c3d3996150ae1911b8e4d53f223704a7732
4
+ data.tar.gz: 70d84e16520960ee51a04f959e77c2598b63ad62
5
5
  SHA512:
6
- metadata.gz: abf4cb6027af4c7fcd9dea2a733eeee612898ecd6bab569f32a57bf18c5d5d5b8610435157cfa4787a97ca84f3bc2eec8aee65a01741b967d78f0123911a4162
7
- data.tar.gz: 699fba307ff3925bda735d4adebf3038f2036fd3f5bf99280c73de160010f326e5f8464094d803271df36a2dfb6313220793bfcbac8a0e26ab3c9e9db5aa016d
6
+ metadata.gz: f50f4a2815352c35e2f9af7caf127d4b114cf597e3edb63697d2c84a88756ae805f4aee37ec6f18a3697a378deeba49d2288eefa952d110bb5d269698a230df0
7
+ data.tar.gz: 028da1fb1837ae1ff3db19234e24aa033a972a3123940d7595489923ebdc2842618917a28e3255df7af7e80b61c307312f99ee2d79f12cf15b560891da56194d
@@ -3,7 +3,7 @@ module Superbolt
3
3
  module Runner
4
4
  class Requeue < ::Superbolt::Runner::AckOne
5
5
  def subscribe
6
- queue.subscribe(ack: true) do |delivery_info, metadata, payload|
6
+ queue.subscribe(ack: true, block: true) do |delivery_info, metadata, payload|
7
7
  message = Superbolt::IncomingMessage.new(delivery_info, payload, channel)
8
8
  process(message)
9
9
  end
@@ -29,7 +29,7 @@ module Superbolt
29
29
  time = parsed_message["future"]
30
30
  q = if Time.parse(time) > Time.now
31
31
  logger.info("Requeueing message to #{time}")
32
- future_queue
32
+ future_queue
33
33
  else
34
34
  logger.info("Sending message #{parsed_message} to worker queue")
35
35
  worker_queue
@@ -51,4 +51,4 @@ module Superbolt
51
51
  end
52
52
  end
53
53
  end
54
- end
54
+ end
@@ -1,5 +1,5 @@
1
1
  module Superbolt
2
2
  module Future
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -1,9 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Superbolt::App do
3
+ describe Superbolt::App do
4
4
  let(:app) {
5
5
  Superbolt::Future::App.new(name, {logger: logger})
6
- }
6
+ }
7
7
 
8
8
  before do
9
9
  future_queue.clear
@@ -25,7 +25,7 @@ describe Superbolt::App do
25
25
  let(:quit_queue) { Superbolt::Queue.new("#{name}_#{env}.future.quit") }
26
26
 
27
27
  context 'when the future message key is in the past' do
28
- let(:message) {
28
+ let(:message) {
29
29
  {
30
30
  origin: 'origin',
31
31
  event: 'do_something',
@@ -38,9 +38,9 @@ describe Superbolt::App do
38
38
 
39
39
  it "moves the message from the future queue to the worker queue" do
40
40
  future_queue.push(message)
41
-
41
+
42
42
  app.run do |arguments|
43
- quit_queue.push({message: 'just because'})
43
+ app.quit
44
44
  end
45
45
 
46
46
  worker_queue.size.should == 1
@@ -49,7 +49,7 @@ describe Superbolt::App do
49
49
  end
50
50
 
51
51
  context 'when the time is in the future' do
52
- let(:message) {
52
+ let(:message) {
53
53
  {
54
54
  origin: 'origin',
55
55
  event: 'do_something',
@@ -62,13 +62,13 @@ describe Superbolt::App do
62
62
 
63
63
  it "puts the message back on the future queue" do
64
64
  future_queue.push(message)
65
-
65
+
66
66
  app.run do |arguments|
67
- quit_queue.push({message: 'just because'})
67
+ app.quit
68
68
  end
69
69
 
70
70
  worker_queue.size.should == 0
71
71
  future_queue.size.should > 1 # there is a race condition with the quit queue, everything async
72
72
  end
73
73
  end
74
- end
74
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superbolt-future
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Deepti Anand
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-05-15 00:00:00.000000000 Z
13
+ date: 2014-07-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: superbolt