radiator 0.3.11 → 0.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/radiator/api.rb +17 -1
- data/lib/radiator/transaction.rb +17 -3
- data/lib/radiator/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: 5c1c1462b5782d4dbdc1611cb6e3fa2977041aa2
|
4
|
+
data.tar.gz: '068894ae4633baddca507d426a8c9d0069569219'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a88b0789b7181d0ea3190bb31f317a23d11c0b914005b163a456675fad137a533084fafacfdd24fb17f107a203e5ea68486af56d7301fbcd51be4ca1d5f8ab33
|
7
|
+
data.tar.gz: f294d130a832f32d5423ccd4d2dff2aee2f71e7e8b44e38c774461d633d5e184fac71351d031496ba653d9cba621d54677741469ecbc26bf565828d7ab2ae903
|
data/Gemfile.lock
CHANGED
data/lib/radiator/api.rb
CHANGED
@@ -519,6 +519,22 @@ module Radiator
|
|
519
519
|
|
520
520
|
"#<#{self.class.name} [#{properties}]>"
|
521
521
|
end
|
522
|
+
|
523
|
+
def stopped?
|
524
|
+
http_active = if @http_memo.nil?
|
525
|
+
false
|
526
|
+
else
|
527
|
+
@http_memo.values.map do |http|
|
528
|
+
if defined?(http.active?)
|
529
|
+
http.active?
|
530
|
+
else
|
531
|
+
false
|
532
|
+
end
|
533
|
+
end.include?(true)
|
534
|
+
end
|
535
|
+
|
536
|
+
@uri.nil? && @http_id.nil? && !http_active && @api.nil? && @block_api.nil?
|
537
|
+
end
|
522
538
|
private
|
523
539
|
def self.methods_json_path
|
524
540
|
@methods_json_path ||= "#{File.dirname(__FILE__)}/methods.json"
|
@@ -759,7 +775,7 @@ module Radiator
|
|
759
775
|
|
760
776
|
@backoff_sleep *= 2
|
761
777
|
sleep @backoff_sleep
|
762
|
-
|
778
|
+
ensure
|
763
779
|
if !!@backoff_at && Time.now.utc - @backoff_at > 300
|
764
780
|
@backoff_at = nil
|
765
781
|
@backoff_sleep = nil
|
data/lib/radiator/transaction.rb
CHANGED
@@ -47,7 +47,14 @@ module Radiator
|
|
47
47
|
@expiration ||= nil
|
48
48
|
@immutable_expiration = !!@expiration
|
49
49
|
|
50
|
-
options = options.merge(
|
50
|
+
options = options.merge(
|
51
|
+
url: @url,
|
52
|
+
chain: @chain,
|
53
|
+
pool_size: 1,
|
54
|
+
persist: false,
|
55
|
+
reuse_ssl_sessions: false
|
56
|
+
)
|
57
|
+
|
51
58
|
@api = Api.new(options)
|
52
59
|
@network_broadcast_api = NetworkBroadcastApi.new(options)
|
53
60
|
|
@@ -94,6 +101,8 @@ module Radiator
|
|
94
101
|
else
|
95
102
|
self
|
96
103
|
end
|
104
|
+
ensure
|
105
|
+
shutdown
|
97
106
|
end
|
98
107
|
|
99
108
|
def operations
|
@@ -108,6 +117,11 @@ module Radiator
|
|
108
117
|
def operations=(operations)
|
109
118
|
@operations = operations
|
110
119
|
end
|
120
|
+
|
121
|
+
def shutdown
|
122
|
+
@api.shutdown if !!@api
|
123
|
+
@network_broadcast_api.shutdown if !!@network_broadcast_api
|
124
|
+
end
|
111
125
|
private
|
112
126
|
def payload
|
113
127
|
@payload ||= {
|
@@ -230,13 +244,13 @@ module Radiator
|
|
230
244
|
|
231
245
|
def self.finalize(api, network_broadcast_api)
|
232
246
|
proc {
|
233
|
-
if !!api
|
247
|
+
if !!api && !api.stopped?
|
234
248
|
puts "DESTROY: #{api.inspect}" if ENV['LOG'] == 'TRACE'
|
235
249
|
api.shutdown
|
236
250
|
api = nil
|
237
251
|
end
|
238
252
|
|
239
|
-
if !!network_broadcast_api
|
253
|
+
if !!network_broadcast_api && !network_broadcast_api.stopped?
|
240
254
|
puts "DESTROY: #{network_broadcast_api.inspect}" if ENV['LOG'] == 'TRACE'
|
241
255
|
network_broadcast_api.shutdown
|
242
256
|
network_broadcast_api = nil
|
data/lib/radiator/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|