manticore 0.5.3-java → 0.5.4-java

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: ce9ff3f2e0cbcfbf063b0d336dd4a8d686c440a0
4
- data.tar.gz: d32fd7d9c65b4dc04b3b587cbdcd9620ad8ccf38
3
+ metadata.gz: 40995659e9b7257957446803d3e19d4ff633fa58
4
+ data.tar.gz: 351c5343d32e1944663d5c796bc221ef3b2453b6
5
5
  SHA512:
6
- metadata.gz: e4576e022aad9f9a9f44d7eb6f19f0497ecce5d6327edf6c979c09f9d11b627f46645949a29b1b359c8f91d804194339868f2d46d0657b09d65843471585536c
7
- data.tar.gz: 5dd8570bf15e2fa83f0c8c20aeeca149da695179c1307a041f38e047976690c718820e153f6b7bff55eb7c7a47c3ae9822992243c546e2ac584271f6efcd74bd
6
+ metadata.gz: 025f7f1769aa67b0edb3bb567be722df970d827d6060802c992b09f24672cc839f74f3a2e7a37aa5cb76ec2ce1e7437dc47c667f2be8b89c666040ed68c1e563
7
+ data.tar.gz: 861b575e15e8a10a6f072495472e693541c7576e172e665320b807a190f50ed95279cb77c92bf2ecd1ce77a2cc433d85132f18d2c8a36452eb8607d6690b90a1
@@ -161,6 +161,9 @@ module Manticore
161
161
  # @option options [boolean] ssl[:track_state] (false) Turn on or off connection state tracking. This helps prevent SSL information from leaking across threads, but means that connections
162
162
  # can't be shared across those threads. This should generally be left off unless you know what you're doing.
163
163
  def initialize(options = {})
164
+ @finalizers = []
165
+ self.class.shutdown_on_finalize self, @finalizers
166
+
164
167
  builder = client_builder
165
168
  builder.set_user_agent options.fetch(:user_agent, "Manticore #{VERSION}")
166
169
  @options = options
@@ -338,8 +341,21 @@ module Manticore
338
341
  @executor
339
342
  end
340
343
 
344
+ def self.shutdown_on_finalize(client, objs)
345
+ ObjectSpace.define_finalizer client, -> {
346
+ objs.each {|obj, args| obj.send(*args) rescue nil }
347
+ }
348
+ end
349
+
341
350
  protected
342
351
 
352
+ # Takes an object and a message to pass to the object to destroy it. This is done rather than
353
+ # a proc to avoid creating a closure that would maintain a reference to this client, which
354
+ # would prevent the client from being cleaned up.
355
+ def finalize(object, args)
356
+ @finalizers << [object, Array(args)]
357
+ end
358
+
343
359
  def url_as_regex(url)
344
360
  if url.is_a?(String)
345
361
  %r{^#{Regexp.escape url}$}
@@ -373,7 +389,7 @@ module Manticore
373
389
  cm.set_validate_after_inactivity options.fetch(:check_connection_timeout, 2_000)
374
390
  cm.set_default_max_per_route options.fetch(:pool_max_per_route, @max_pool_size)
375
391
  cm.set_max_total @max_pool_size
376
- at_exit { cm.shutdown }
392
+ finalize cm, :shutdown
377
393
  end
378
394
  end
379
395
  end
@@ -381,7 +397,7 @@ module Manticore
381
397
  def create_executor_if_needed
382
398
  return @executor if @executor
383
399
  @executor = Executors.new_cached_thread_pool
384
- at_exit { @executor.shutdown }
400
+ finalize @executor, :shutdown
385
401
  end
386
402
 
387
403
  def request(klass, url, options, &block)
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module Manticore
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
metadata CHANGED
@@ -1,36 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manticore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: java
6
6
  authors:
7
7
  - Chris Heald
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIDaDCCAlCgAwIBAgIBATANBgkqhkiG9w0BAQUFADA9MQ8wDQYDVQQDDAZjaGVh
14
- bGQxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2NvbTAe
15
- Fw0xNTAzMDQwNTA5MjhaFw0xNjAzMDMwNTA5MjhaMD0xDzANBgNVBAMMBmNoZWFs
16
- ZDEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29tMIIB
17
- IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwcnX2yl+rbjUztC4V+iUJgWv
18
- NPxqU4bQBaL+w00wVABWr04Hjg+cEkqiJ6A0kXxZIz5uXKhhvsaO50NvHfplVcUf
19
- BxQabIfCS79xdvexXN0or3F5saatGaGa4cj/0uUHjX7w+K5MpEVfbjJp0uAKp62B
20
- wUU2ilmn7EvZhEUPOMQi01t8z8OsOGc8kF2UtU1kGCxLV7eThWqu8CdXrux5E140
21
- 7SnFnPlnXNeHqwZdOMZzQ9PiTQAPCKO3AY0aBFQeG3wlFPqkcEjOrtV1h7werUwz
22
- aNb4t5sAuu0f/9B646BOjiMgj1WeUlhgiAsaF5kVvLFNCxwS/xpcN3X01M2KdQID
23
- AQABo3MwcTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUtFVpwfEG
24
- 78mBd2ulzsS+SlffdOcwGwYDVR0RBBQwEoEQY2hlYWxkQGdtYWlsLmNvbTAbBgNV
25
- HRIEFDASgRBjaGVhbGRAZ21haWwuY29tMA0GCSqGSIb3DQEBBQUAA4IBAQApPK7H
26
- 4nM6IAzpeA1fYuBsH+Z7ENr2p02ElinUVZMiUmWsFjoZqDLWDWIHJnlJCwUZjnBb
27
- gXpEFiKiS9XgkRmIOIb3fpD9M574vo/AyvAzvQHLCN7p86IFWQSTsAQptcPfQBL7
28
- 8yWPlXfbX6qxnLHrkjcSnRo61v4NqU+y6x4WEX6Dp90DK3mNLgk7kQk4GhBXevnV
29
- 4Mmxp+JAtISoamMfjldbJhCMkWaZUwDsdFzSfTXl7yg772IYZfICzD7eENPiIcmu
30
- cnyabLOcGIKZNxvnSfwOuCBnjgoSOyJi/n48n1s+OPB/OmPJoWmhKu2DO4sUb4+K
31
- /3Mhp5UWSl9SmDR1
32
- -----END CERTIFICATE-----
33
- date: 2016-02-23 00:00:00.000000000 Z
10
+ cert_chain: []
11
+ date: 2016-03-14 00:00:00.000000000 Z
34
12
  dependencies:
35
13
  - !ruby/object:Gem::Dependency
36
14
  requirement: !ruby/object:Gem::Requirement
checksums.yaml.gz.sig DELETED
Binary file
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
@@ -1 +0,0 @@
1
- q[ d�J�M,�������:�=X�2E6