thrifty-bunny 0.0.3 → 0.0.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.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/examples/calculator/server.start +3 -3
- data/lib/thrifty_bunny/client_transport.rb +8 -7
- data/lib/thrifty_bunny/rpc_server.rb +2 -7
- data/lib/thrifty_bunny/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c0438879bbc0d6b1abd21204dfd40d048146471
|
4
|
+
data.tar.gz: a5f41903031f967e76747f02ca6b7778e8f5adad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d63d6f6c2fb293e6377645af71fd3a4d53197eeaf2aa74f7566eda21f9b614fe74498e2327d66677134eec182ac2df760f99a08b2ed8b2c4e628f26067aea724
|
7
|
+
data.tar.gz: 3d328c0400aa7da2cc00429618a44eb1b60e1b60f3edbabe2c8871915978f2331d11d64234dd57bb7d47a90f8be2dbf2f721176babb08840ef08529f6e997450
|
data/Gemfile
CHANGED
@@ -13,7 +13,7 @@ module Calculator
|
|
13
13
|
value1 + value2
|
14
14
|
end
|
15
15
|
def divide(dividend, divisor)
|
16
|
-
dividend / divisor
|
16
|
+
dividend.to_f / divisor.to_f
|
17
17
|
end
|
18
18
|
|
19
19
|
def ping
|
@@ -30,7 +30,7 @@ module Calculator
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def serve
|
33
|
-
service.serve(log_messages:
|
33
|
+
service.serve(log_messages: false, prefetch: 2)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -39,4 +39,4 @@ end
|
|
39
39
|
server = Calculator::Server.new
|
40
40
|
puts "Starting server ..."
|
41
41
|
server.serve
|
42
|
-
puts "Done."
|
42
|
+
puts "Done."
|
@@ -54,17 +54,18 @@ module ThriftyBunny
|
|
54
54
|
#just send and go!
|
55
55
|
def flush(options={})
|
56
56
|
|
57
|
-
operation = options
|
57
|
+
operation = options[:operation] || ""
|
58
58
|
blocking = options.has_key?(:blocking) ? options[:blocking] : true
|
59
|
-
msg_timeout = options
|
59
|
+
msg_timeout = options[:msg_timeout] || 10
|
60
60
|
log_messages = options.has_key?(:log_messages) ? options[:log_messages] : true
|
61
61
|
|
62
62
|
correlation_id = self.generate_uuid
|
63
63
|
|
64
|
-
headers = {
|
65
|
-
|
66
|
-
|
67
|
-
|
64
|
+
headers = {
|
65
|
+
:service_name => @service_queue_name,
|
66
|
+
:operation => operation,
|
67
|
+
:response_required => blocking, #Tell the receiver if a response is required
|
68
|
+
:from_name => @from_name
|
68
69
|
}
|
69
70
|
|
70
71
|
#Publish the message
|
@@ -126,4 +127,4 @@ module ThriftyBunny
|
|
126
127
|
end
|
127
128
|
end
|
128
129
|
|
129
|
-
end
|
130
|
+
end
|
@@ -41,14 +41,9 @@ module ThriftyBunny
|
|
41
41
|
|
42
42
|
#Create a channel to the service queue
|
43
43
|
@request_channel = @conn.create_channel(nil, max_messages )
|
44
|
+
@request_channel.prefetch(options[:prefetch]) if options[:prefetch]
|
44
45
|
|
45
|
-
|
46
|
-
@service_exchange = @request_channel.default_exchange
|
47
|
-
@request_queue = @request_channel.queue(@queue_name, :auto_delete => true)
|
48
|
-
else
|
49
|
-
@service_exchange = @request_channel.direct(@exchange,:durable => true)
|
50
|
-
@request_queue = @request_channel.queue(@queue_name, :auto_delete => true).bind(@service_exchange, :routing_key => @queue_name)
|
51
|
-
end
|
46
|
+
@request_queue = @request_channel.queue(@queue_name, :auto_delete => true)
|
52
47
|
|
53
48
|
@request_queue.subscribe(:block => true) do |delivery_info, properties, payload|
|
54
49
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thrifty-bunny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill Siggelkow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|