norikra-client 0.0.1 → 0.0.2

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: f2c308ce73a1118b36f4155eee862d21916679f1
4
- data.tar.gz: 0c4304b4ecfe885f84c4dfb66ca48cd50a9701dd
3
+ metadata.gz: 8cb324acca7e0b6a31aa6afe227badf6748f314c
4
+ data.tar.gz: a66a8d60c52050c3813dd2616bab51f860569aec
5
5
  SHA512:
6
- metadata.gz: e1ddbaccf2d35abaa8b145a6345ccfe40b1c53c988ecdeb4c0a8ce6f98d331f19ace9533e44ed142139831f36e65f276216126e328f27e8244885e633d29a535
7
- data.tar.gz: 5835f4ca5ce86d461b69fd59232b3d2148d466293a59ee0ab6f56cec1e683de5d3cbed42fa77a15c6676617ed16aa5640a1e6d5b8c2df12e07fea1a1b3a382a2
6
+ metadata.gz: 6b760031f049ff7676fcc8bc69c3e9490d9f7db937e9d1a82ab321c9e802256293d889c778a6fa1a415940f77f6abec81fd90cbc7923a1ce5658018a1e320a87
7
+ data.tar.gz: d15e35de3e151be2833d76f672a314a424922d5eac8d5e8ff1d795995dcc10f9a137a5fe6998c578510a921480208ace92d4bd10d83b5ded0a346f250b3004ce
@@ -5,9 +5,14 @@ require 'msgpack-rpc-over-http'
5
5
  module Norikra
6
6
  class Client
7
7
  RPC_DEFAULT_PORT = 26571
8
+ TIMEOUT_OPTIONS = [:connect_timeout, :send_timeout, :receive_timeout]
8
9
 
9
- def initialize(host='localhost', port=RPC_DEFAULT_PORT)
10
+ def initialize(host='localhost', port=RPC_DEFAULT_PORT, opts={})
10
11
  @client = MessagePack::RPCOverHTTP::Client.new("http://#{host}:#{port}/")
12
+
13
+ @client.connect_timeout = opts[:connect_timeout] if opts.has_key?(:connect_timeout) && @client.respond_to?('connect_timeout='.to_sym)
14
+ @client.send_timeout = opts[:send_timeout] if opts.has_key?(:send_timeout) && @client.respond_to?('send_timeout='.to_sym)
15
+ @client.receive_timeout = opts[:receive_timeout] if opts.has_key?(:receive_timeout) && @client.respond_to?('receive_timeout='.to_sym)
11
16
  end
12
17
 
13
18
  def targets
@@ -1,5 +1,5 @@
1
1
  module Norikra
2
2
  class Client
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: norikra-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - TAGOMORI Satoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-21 00:00:00.000000000 Z
11
+ date: 2013-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack-rpc-over-http