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 +4 -4
- data/lib/norikra/client.rb +6 -1
- data/lib/norikra/client/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: 8cb324acca7e0b6a31aa6afe227badf6748f314c
|
4
|
+
data.tar.gz: a66a8d60c52050c3813dd2616bab51f860569aec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b760031f049ff7676fcc8bc69c3e9490d9f7db937e9d1a82ab321c9e802256293d889c778a6fa1a415940f77f6abec81fd90cbc7923a1ce5658018a1e320a87
|
7
|
+
data.tar.gz: d15e35de3e151be2833d76f672a314a424922d5eac8d5e8ff1d795995dcc10f9a137a5fe6998c578510a921480208ace92d4bd10d83b5ded0a346f250b3004ce
|
data/lib/norikra/client.rb
CHANGED
@@ -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
|
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.
|
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-
|
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
|