async-io 1.30.1 → 1.30.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78e506c80ee6dca2ec605f761ba21b978eae84ed299a9ec9aecad63b5c7cd71b
4
- data.tar.gz: 2b8024c08e12cf4c1d7aae0765acc2d255c992a86550b5e734491e91101d0647
3
+ metadata.gz: 61a14845c7d079931211e6ac68687686d7be2408f53967980594d13a7e526036
4
+ data.tar.gz: 6e6b66368d65a53f0ca0a313aab8a6857821d098c2c7316c8dae8d67329fa1c4
5
5
  SHA512:
6
- metadata.gz: c4716622a716f04a70848e3775f3d7d25ff32c0b05176b4b4d9db8807fa16f53ebc0c9537764c848ec5036c9e9dfdc1bdefce2a3eec9dce739a89f556333cde1
7
- data.tar.gz: c2bc7594737d8e2094fa8278d3187e8ca287eda156050593aa59e5fcbc9d9e449a32d10f769b6af6150ff61e6855939f06d4de4e606c4bbddb37fc85edcdecd2
6
+ metadata.gz: c49e189437e5c89c011323cbc73c24c799d08e479b85fbf513a96f58b5732262085755750474a048e415a43e703bb78f28100f7a87ac7d506b966357d5d20d6a
7
+ data.tar.gz: b65bfd71f89d9659dc5f30464c820df28a13b14294d7e4cb8ef432cd698b19fc09208a57f3ae2206c4c28db61ddbebfd0a334b9de50d0b89b3f28e621949cc63
@@ -30,7 +30,7 @@ module Async
30
30
 
31
31
  # Asynchronous TCP socket wrapper.
32
32
  class SSLSocket < Generic
33
- wraps OpenSSL::SSL::SSLSocket, :alpn_protocol, :cert, :cipher, :client_ca, :context, :getsockopt, :hostname, :hostname=, :npn_protocol, :peer_cert, :peer_cert_chain, :pending, :post_connection_check, :setsockopt, :session, :session=, :session_reused?, :ssl_version, :state, :sync_close, :sync_close=, :sysclose, :verify_result, :tmp_key
33
+ wraps OpenSSL::SSL::SSLSocket, :alpn_protocol, :cert, :cipher, :client_ca, :context, :finished_message, :peer_finished_message, :getsockopt, :hostname, :hostname=, :npn_protocol, :peer_cert, :peer_cert_chain, :pending, :post_connection_check, :setsockopt, :session, :session=, :session_reused?, :ssl_version, :state, :sync_close, :sync_close=, :sysclose, :verify_result, :tmp_key
34
34
 
35
35
  wrap_blocking_method :accept, :accept_nonblock
36
36
  wrap_blocking_method :connect, :connect_nonblock
@@ -29,24 +29,18 @@ module Async
29
29
  @parent = parent
30
30
  end
31
31
 
32
- def async(parent: (@parent or Task.current))
33
- parent.async do |task|
34
- notification = Async::IO::Notification.new
35
-
36
- thread = Thread.new do
37
- yield
38
- ensure
39
- notification.signal
40
- end
41
-
42
- task.annotate "Waiting for thread to finish..."
43
-
44
- notification.wait
45
-
46
- thread.value
47
- ensure
48
- if thread&.alive?
49
- thread.raise(Stop)
32
+ if Async::Scheduler.supported?
33
+ def async(parent: (@parent or Task.current))
34
+ parent.async do
35
+ thread = ::Thread.new do
36
+ yield
37
+ end
38
+
39
+ thread.join
40
+ rescue Stop
41
+ if thread&.alive?
42
+ thread.raise(Stop)
43
+ end
50
44
 
51
45
  begin
52
46
  thread.join
@@ -54,8 +48,36 @@ module Async
54
48
  # Ignore.
55
49
  end
56
50
  end
57
-
58
- notification&.close
51
+ end
52
+ else
53
+ def async(parent: (@parent or Task.current))
54
+ parent.async do |task|
55
+ notification = Async::IO::Notification.new
56
+
57
+ thread = ::Thread.new do
58
+ yield
59
+ ensure
60
+ notification.signal
61
+ end
62
+
63
+ task.annotate "Waiting for thread to finish..."
64
+
65
+ notification.wait
66
+
67
+ thread.value
68
+ ensure
69
+ if thread&.alive?
70
+ thread.raise(Stop)
71
+
72
+ begin
73
+ thread.join
74
+ rescue Stop
75
+ # Ignore.
76
+ end
77
+ end
78
+
79
+ notification&.close
80
+ end
59
81
  end
60
82
  end
61
83
  end
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Async
24
24
  module IO
25
- VERSION = "1.30.1"
25
+ VERSION = "1.30.2"
26
26
  end
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-io
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.30.1
4
+ version: 1.30.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-18 00:00:00.000000000 Z
11
+ date: 2021-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  - !ruby/object:Gem::Version
190
190
  version: '0'
191
191
  requirements: []
192
- rubygems_version: 3.1.2
192
+ rubygems_version: 3.2.3
193
193
  signing_key:
194
194
  specification_version: 4
195
195
  summary: Provides support for asynchonous TCP, UDP, UNIX and SSL sockets.