combi 0.0.13 → 0.0.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61873a14703492a9006d76ea15b32bc49cf5e0dc
4
- data.tar.gz: a2d86582246b74a58647a9e2a26774c98af52c07
3
+ metadata.gz: f3a283e392128d694635fce6d3c7dd96de05d5ac
4
+ data.tar.gz: 764eb5e7ad402be1b8940982e77dc16cf1fa29cd
5
5
  SHA512:
6
- metadata.gz: 4fdb24566230c75f2f0550a7ee8060b51b611ac78871a170f54723ae3f0fe3008c50490f9db4313316efe9fa22f17446e6db8f4817ebe94144438bb667c37c20
7
- data.tar.gz: 2ee0cdf9f93c8717e35cbeab3f190546709385853734dd2f8e16c672efb27c87d3d8f6423e1787534edc6965eebda6d799ccbb8b331338b1bae30ea968818481
6
+ metadata.gz: 94f13d90ebe75c453e209ae69109e4a0173c6df4c4a1258fc26b79b07ff1e002db408584dc98a0da2e526df8581dda276f4bd58db2825a0df7d850458f47e351
7
+ data.tar.gz: ff64c2764b536b5a7bc501a3228fc0eb431eb4215e2492f7572abe91bb07744915b36606297652e4740ebd86d60f5d2f3620103044a4eb9b021f870d6762dbfc
@@ -234,7 +234,7 @@ module Combi
234
234
  @ready.callback do |r|
235
235
  web_socket = @machine.ws || options[:ws]
236
236
  log "sending request #{msg.inspect}"
237
- web_socket.send msg.to_json
237
+ web_socket.send msg.to_json unless web_socket.nil?
238
238
  end
239
239
  waiter
240
240
  end
@@ -87,7 +87,7 @@ module Combi
87
87
  def call(kind, message, options = {})
88
88
  log "sending request #{kind} #{message.inspect[0..500]} with options #{options.inspect}"
89
89
  raise "RPC is not enabled or reply_to is not included" if (@rpc_queue.nil? || @rpc_queue.name.nil?) && options[:reply_to].nil?
90
- options[:timeout] ||= RPC_DEFAULT_TIMEOUT
90
+ options[:expiration] = (options[:timeout] || RPC_DEFAULT_TIMEOUT) * 1000
91
91
  options[:routing_key] ||= 'rcalls_queue'
92
92
  options[:reply_to] ||= @rpc_queue.name
93
93
  request = {
@@ -1,3 +1,3 @@
1
1
  module Combi
2
- VERSION = '0.0.13'
2
+ VERSION = '0.0.14'
3
3
  end
@@ -80,4 +80,29 @@ describe 'Combi::WebSocket' do
80
80
  end
81
81
  end
82
82
  end
83
+
84
+ context "it don't send messages when is not connected" do
85
+ Then do
86
+ em do
87
+ provider.add_service null_service
88
+ prepare
89
+ EM::add_timer(0.1) do
90
+ consumer.stop!
91
+ end
92
+ EM::add_timer(0.2) do
93
+ EM.synchrony do
94
+ provider.stop!
95
+ service_result = EM::Synchrony.sync consumer.request(:null, :do_it, {}, { timeout: 0.3 })
96
+ service_result.should be_a Hash
97
+ service_result.should have_key 'error'
98
+ service_result['error'].should eq 'Timeout::Error'
99
+ done(0.3) #timeout response must came before this timeout
100
+ end
101
+ provider.stop!
102
+ consumer.stop!
103
+ end
104
+ end
105
+ end
106
+ end
107
+
83
108
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: combi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - German Del Zotto
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-07 00:00:00.000000000 Z
12
+ date: 2014-06-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yajl-ruby
@@ -196,8 +196,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  version: '0'
197
197
  requirements: []
198
198
  rubyforge_project:
199
- rubygems_version: 2.2.2
199
+ rubygems_version: 2.2.0
200
200
  signing_key:
201
201
  specification_version: 4
202
202
  summary: Mini Bus for microservices
203
203
  test_files: []
204
+ has_rdoc: