rjr 0.19.2 → 0.19.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: 67d23eb4f09f94c96a7d601c338b4d5088605c24
4
- data.tar.gz: 53bbd5973ce99fa089c5d4bf560e2e9fe6c9005c
3
+ metadata.gz: ef759c6e069a5831e1b57e26bdd3e8aeb560f82d
4
+ data.tar.gz: 7986d34c9707c318afd490db353c47ea65b59a5d
5
5
  SHA512:
6
- metadata.gz: 9b8a199e88e55fd824cdabaeebf750cd234624ade0b9fc2acd9640aec729d5a3ab4339f5ef0769f707916a830f987d7a95c680e7e0ea07b4f526bd97b1394d3c
7
- data.tar.gz: 55e17f0513fedef6f3e5dccae5673317bf5943988ae5d2146c7c2d76fa7aaee0ce003495c774ad3b623421efdff5127338d88cbf78792f3ecde9434dd9629f31
6
+ metadata.gz: 3da6b7f0a0549219905d532d871d649f8917e6d958eff478fc632f7de4bdb495ac40fa50753d60539576dd11ad7c4c319d8314dfac343b6fae9747ac92e9b408
7
+ data.tar.gz: 27de0be3ee6605c79c8258ac9479cb656021d4c3263c07028cf9f79c595aa6a466fd423697b41266102886e0d896dd5e235c67ac413e201833f71e99e33b7df8
@@ -180,7 +180,7 @@ class Dispatcher
180
180
  # TODO needs to be constantized first (see TODO in lib/rjr/message)
181
181
  # raise result.error_class.new(result.error_msg) unless result.success
182
182
  #else
183
- raise Exception, result.error_msg
183
+ fail result.error_msg
184
184
  #end
185
185
  end
186
186
  return result.result
@@ -280,7 +280,7 @@ class Node
280
280
  @pending.delete_if { |_, start_time| (now - start_time) > @timeout }
281
281
  end
282
282
  pending_ids = @pending.keys
283
- raise Exception, 'Timed out' unless pending_ids.include? message_id
283
+ fail 'Timed out' unless pending_ids.include? message_id
284
284
 
285
285
  # Prune invalid responses
286
286
  @responses.keep_if { |response| @pending.has_key? response.first }
@@ -197,7 +197,7 @@ class AMQP < RJR::Node
197
197
  result = wait_for_result(message)
198
198
 
199
199
  if result.size > 2
200
- raise Exception, result[2]
200
+ fail result[2]
201
201
  end
202
202
  return result[1]
203
203
  end
@@ -117,7 +117,7 @@ class Local < RJR::Node
117
117
  res = wait_for_result(message)
118
118
 
119
119
  if res.size > 2
120
- raise Exception, res[2]
120
+ fail res[2]
121
121
  end
122
122
  return res[1]
123
123
  end
@@ -184,7 +184,7 @@ class TCP < RJR::Node
184
184
  result = wait_for_result(message)
185
185
 
186
186
  if result.size > 2
187
- raise Exception, result[2]
187
+ fail result[2]
188
188
  end
189
189
  return result[1]
190
190
  end
@@ -151,7 +151,7 @@ class Unix < RJR::Node
151
151
  result = wait_for_result(message)
152
152
 
153
153
  if result.size > 2
154
- raise Exception, result[2]
154
+ fail result[2]
155
155
  end
156
156
  return result[1]
157
157
  end
@@ -172,7 +172,7 @@ class Web < RJR::Node
172
172
  # TODO optional timeout for response ?
173
173
  result = wait_for_result(message)
174
174
  if result.size > 2
175
- raise Exception, result[2]
175
+ fail result[2]
176
176
  end
177
177
  return result[1]
178
178
  end
@@ -149,7 +149,7 @@ class WS < RJR::Node
149
149
  result = wait_for_result(message)
150
150
 
151
151
  if result.size > 2
152
- raise Exception, result[2]
152
+ fail result[2]
153
153
  end
154
154
  return result[1]
155
155
  end
@@ -1,3 +1,3 @@
1
1
  module RJR
2
- VERSION = '0.19.2'
2
+ VERSION = '0.19.3'
3
3
  end
@@ -52,6 +52,9 @@ module RJR::Nodes
52
52
  end
53
53
 
54
54
  it "should invoke callbacks" do
55
+ # same workaround as in #notify test above
56
+ m,c = Mutex.new, ConditionVariable.new
57
+
55
58
  node = Local.new
56
59
  cbp = nil
57
60
  foobar_invoked = false
@@ -63,9 +66,11 @@ module RJR::Nodes
63
66
  node.dispatcher.handle('callback') { |param|
64
67
  callback_invoked = true
65
68
  cbp = param
69
+ m.synchronize { c.signal }
66
70
  }
67
71
 
68
72
  node.invoke 'foobar', 'myparam'
73
+ m.synchronize { c.wait m, 0.1 } unless callback_invoked
69
74
  foobar_invoked.should be_truthy
70
75
  callback_invoked.should be_truthy
71
76
  cbp.should == 'cp'
metadata CHANGED
@@ -1,14 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rjr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.2
4
+ version: 0.19.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mo Morsi
8
+ - Ladislav Smola
9
+ - André Dieb Martins
10
+ - Eric Bakan
11
+ - Jonas Collberg
8
12
  autorequire:
9
13
  bindir: bin
10
14
  cert_chain: []
11
- date: 2015-11-02 00:00:00.000000000 Z
15
+ date: 2015-11-10 00:00:00.000000000 Z
12
16
  dependencies:
13
17
  - !ruby/object:Gem::Dependency
14
18
  name: rspec