thrifter 0.1.1 → 0.1.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/lib/thrifter.rb +7 -7
- data/lib/thrifter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d4d2c07c4f438c528cbee2fb79eaaad32d492e0
|
4
|
+
data.tar.gz: 04118a2ca3fdc79444b6454ab63897344ab09ae2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57afa5cab7442e4af1bb49cc35b856ebadc9dd94fe83cb36daf069042ad8ac93e368793b376410e1da3539adbd87cbf3db0a809b957279a9e6c7b9971db9b0e7
|
7
|
+
data.tar.gz: d99656e443fbf32b2a16fc805d211d92549b06e69b58480961c6f823775ed2071a0afb6ea755f8d3b505b911ccc2e36f56881b7495737d786e4a7d392e2f35a0
|
data/lib/thrifter.rb
CHANGED
@@ -126,12 +126,12 @@ module Thrifter
|
|
126
126
|
end
|
127
127
|
|
128
128
|
def initialize(client = nil)
|
129
|
-
if client
|
129
|
+
if !client
|
130
130
|
fail ArgumentError, 'config.uri not set!' unless config.uri
|
131
131
|
|
132
|
-
uri = URI(config.uri)
|
132
|
+
@uri = URI(config.uri)
|
133
133
|
|
134
|
-
fail ArgumentError, 'URI did not contain port' unless uri.port
|
134
|
+
fail ArgumentError, 'URI did not contain port' unless @uri.port
|
135
135
|
end
|
136
136
|
|
137
137
|
@pool = ConnectionPool.new size: config.pool_size.to_i, timeout: config.pool_timeout.to_f do
|
@@ -144,14 +144,14 @@ module Thrifter
|
|
144
144
|
# application may have configured.
|
145
145
|
stack.use Metrics, config.statsd
|
146
146
|
|
147
|
-
if client
|
148
|
-
|
147
|
+
if client
|
148
|
+
stack.use DirectDispatcher, client
|
149
|
+
else
|
150
|
+
socket = Thrift::Socket.new @uri.host, @uri.port, config.rpc_timeout.to_f
|
149
151
|
transport = config.transport.new socket
|
150
152
|
protocol = config.protocol.new transport
|
151
153
|
|
152
154
|
stack.use Dispatcher, transport, client_class.new(protocol)
|
153
|
-
else
|
154
|
-
stack.use DirectDispatcher, client
|
155
155
|
end
|
156
156
|
|
157
157
|
stack.finalize!
|
data/lib/thrifter/version.rb
CHANGED