amqp-boilerplate 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG
CHANGED
data/lib/amqp/boilerplate.rb
CHANGED
@@ -44,7 +44,7 @@ module AMQP
|
|
44
44
|
AMQP::Boilerplate.logger.info("[#{self.name}.boot] Started AMQP (Server Type: #{AMQP::Utilities::EventLoopHelper.server_type || 'unknown'})")
|
45
45
|
|
46
46
|
EventMachine.next_tick do
|
47
|
-
AMQP.channel ||= AMQP::Channel.new(AMQP.connection
|
47
|
+
AMQP.channel ||= AMQP::Channel.new(AMQP.connection)
|
48
48
|
|
49
49
|
load_consumers
|
50
50
|
|
@@ -60,6 +60,7 @@ module AMQP
|
|
60
60
|
|
61
61
|
channel = AMQP.channel
|
62
62
|
channel.on_error(&consumer.method(:handle_channel_error))
|
63
|
+
channel.prefetch(AMQP::Boilerplate.consumer_prefetch)
|
63
64
|
|
64
65
|
queue = channel.queue(@queue_name, @queue_options)
|
65
66
|
# Binding a queue to a exchange by passing a string (instead of a AMQP::Exchange instance)
|
@@ -6,6 +6,7 @@ describe AMQP::Boilerplate::Consumer do
|
|
6
6
|
AMQP::Boilerplate.stub(:logger).and_return(mock.as_null_object)
|
7
7
|
@channel = mock(AMQP::Channel)
|
8
8
|
@channel.stub(:on_error).and_return(true)
|
9
|
+
@channel.stub(:prefetch).and_return(@channel)
|
9
10
|
end
|
10
11
|
|
11
12
|
describe "#handle_channel_error" do
|
@@ -66,6 +67,11 @@ describe AMQP::Boilerplate::Consumer do
|
|
66
67
|
BarConsumer.start
|
67
68
|
end
|
68
69
|
|
70
|
+
it "should pass on the prefetch channel parameter" do
|
71
|
+
@channel.should_receive(:prefetch).with(0).and_return(@channel)
|
72
|
+
BarConsumer.start
|
73
|
+
end
|
74
|
+
|
69
75
|
it "should instantiate a consumer" do
|
70
76
|
BarConsumer.should_receive(:new).and_return(@consumer)
|
71
77
|
BarConsumer.start
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amqp-boilerplate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 4
|
10
|
+
version: 1.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Patrick Baselier
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-05-
|
19
|
+
date: 2012-05-10 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|