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 +4 -4
- data/lib/async/io/ssl_socket.rb +1 -1
- data/lib/async/io/threads.rb +42 -20
- data/lib/async/io/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61a14845c7d079931211e6ac68687686d7be2408f53967980594d13a7e526036
|
4
|
+
data.tar.gz: 6e6b66368d65a53f0ca0a313aab8a6857821d098c2c7316c8dae8d67329fa1c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c49e189437e5c89c011323cbc73c24c799d08e479b85fbf513a96f58b5732262085755750474a048e415a43e703bb78f28100f7a87ac7d506b966357d5d20d6a
|
7
|
+
data.tar.gz: b65bfd71f89d9659dc5f30464c820df28a13b14294d7e4cb8ef432cd698b19fc09208a57f3ae2206c4c28db61ddbebfd0a334b9de50d0b89b3f28e621949cc63
|
data/lib/async/io/ssl_socket.rb
CHANGED
@@ -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
|
data/lib/async/io/threads.rb
CHANGED
@@ -29,24 +29,18 @@ module Async
|
|
29
29
|
@parent = parent
|
30
30
|
end
|
31
31
|
|
32
|
-
|
33
|
-
parent
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
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
|
-
|
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
|
data/lib/async/io/version.rb
CHANGED
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.
|
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:
|
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.
|
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.
|