gilmour 0.4.1 → 0.4.2
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/examples/composition.rb +2 -0
- data/lib/gilmour/backends/backend.rb +3 -3
- data/lib/gilmour/base.rb +5 -2
- data/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: ccbd3758aca3cea1d80b09216e63f3988d54653a
|
4
|
+
data.tar.gz: c8f34222db03de9c05da741c793266a4250b23a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce2e1cee491383b8980af8e64ef21aa9e52c03f3f492fe856421efa1e8fa109c3d29c2b4c40bd5012b53653f8db18f2b5b9d3215161405243c7c94621dbfeca1
|
7
|
+
data.tar.gz: 9d100cba54eb50a0a3a7ea971fffaf42e014e1264f13e19bdafa9d470cba82550b876f5cb87092694983266a734dcc952610d31c7c88c26f62a41e8b63477a49
|
data/examples/composition.rb
CHANGED
@@ -22,6 +22,8 @@ gilmour.reply_to 'three' do
|
|
22
22
|
respond request.body.merge({'three' => 'foo'})
|
23
23
|
end
|
24
24
|
|
25
|
+
sleep 1
|
26
|
+
|
25
27
|
composed = gilmour.compose([{topic: 'one'}, {topic: 'two'},
|
26
28
|
{topic: 'three', message: {'anotherthree' => 'anotherthree'}}])
|
27
29
|
compose_waiter = Gilmour::Waiter.new
|
@@ -155,10 +155,10 @@ module Gilmour
|
|
155
155
|
raise RuntimeError.new("Duplicate reply handler for #{topic}:#{group}")
|
156
156
|
end
|
157
157
|
opts[:type] = :reply
|
158
|
-
opts[:
|
158
|
+
opts[:exclusive] = true
|
159
159
|
add_listener(req_topic, opts, &blk)
|
160
160
|
end
|
161
|
-
|
161
|
+
|
162
162
|
# Sets up a slot listener
|
163
163
|
# Params:
|
164
164
|
# +topic+:: The topic to listen on
|
@@ -171,7 +171,7 @@ module Gilmour
|
|
171
171
|
def slot(topic, options={}, &blk)
|
172
172
|
opts = options.dup
|
173
173
|
stopic = slot_destination(topic)
|
174
|
-
if opts[:
|
174
|
+
if opts[:exclusive] && excl_dups?(stopic, opts)
|
175
175
|
raise RuntimeError.new("Duplicate reply handler for #{topic}:#{group}")
|
176
176
|
end
|
177
177
|
opts[:type] = :slot
|
data/lib/gilmour/base.rb
CHANGED
@@ -62,7 +62,7 @@ module Gilmour
|
|
62
62
|
# excl:: If true, this listener is added to a group of listeners
|
63
63
|
# with the same name as the name of the class in which this
|
64
64
|
# method is called. A message sent to the _topic_ will be
|
65
|
-
# processed by at most one listener from a group
|
65
|
+
# processed by at most one listener from a group
|
66
66
|
# timeout:: Maximum duration (seconds) that a subscriber has to
|
67
67
|
# finish the task. If the execution exceeds the timeout, gilmour
|
68
68
|
# responds with status {code:409, data: nil}
|
@@ -117,7 +117,10 @@ module Gilmour
|
|
117
117
|
# +dir+:: relative path of directory to load subscribers from
|
118
118
|
def load_all(dir = nil)
|
119
119
|
dir ||= (subscribers_path || DEFAULT_SUBSCRIBER_PATH)
|
120
|
-
Dir["#{dir}/*.rb"].each
|
120
|
+
Dir["#{dir}/*.rb"].each do |f|
|
121
|
+
$stderr.puts f
|
122
|
+
require f
|
123
|
+
end
|
121
124
|
end
|
122
125
|
|
123
126
|
def load_subscriber(path) #:nodoc:
|
data/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gilmour
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aditya Godbole
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-08-
|
12
|
+
date: 2015-08-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|