async-io 1.8.2 → 1.8.4
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/notification.rb +8 -1
- data/lib/async/io/ssl_socket.rb +3 -3
- data/lib/async/io/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28560a2c37617bcd0a356c1cdf4a3d6cae716dcb41cdc687685428bf5d521b6c
|
4
|
+
data.tar.gz: 7c0ab76b2c9be55a2b6e7660293439a5748ce80fbdae2f5f25f71bfb9e7156ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9954fe457d3fc5883bdfd59f5f2b17cab94cee653ba0cea083afa23954ff91e2297d342ed805d2b4c0d5aeae956e4cb9a2e341e60def9d5003e08b7ee09a2b7
|
7
|
+
data.tar.gz: 8c59a579a8cd7d2425f298cf98b1caba1acdd6263e79bad028baadc6e517c2a1447e5147e415ba766c1c3446bed938c29f628734fe51528345318d692d75d999
|
@@ -27,6 +27,7 @@ module Async
|
|
27
27
|
def initialize
|
28
28
|
pipe = ::IO.pipe
|
29
29
|
|
30
|
+
# We could call wait and signal from different reactors/threads/processes, so we don't create wrappers here, because they are not thread safe by design.
|
30
31
|
@input = pipe.first
|
31
32
|
@output = pipe.last
|
32
33
|
end
|
@@ -41,12 +42,18 @@ module Async
|
|
41
42
|
def wait
|
42
43
|
wrapper = Async::IO::Generic.new(@input)
|
43
44
|
wrapper.read(1)
|
45
|
+
ensure
|
46
|
+
# Remove the wrapper from the reactor.
|
47
|
+
wrapper.reactor = nil
|
44
48
|
end
|
45
49
|
|
46
50
|
# Signal to a given task that it should resume operations.
|
47
51
|
# @return [void]
|
48
52
|
def signal
|
49
|
-
@output
|
53
|
+
wrapper = Async::IO::Generic.new(@output)
|
54
|
+
wrapper.write(".")
|
55
|
+
ensure
|
56
|
+
wrapper.reactor = nil
|
50
57
|
end
|
51
58
|
end
|
52
59
|
end
|
data/lib/async/io/ssl_socket.rb
CHANGED
@@ -28,7 +28,7 @@ module Async
|
|
28
28
|
|
29
29
|
# Asynchronous TCP socket wrapper.
|
30
30
|
class SSLSocket < Generic
|
31
|
-
wraps ::OpenSSL::SSL::SSLSocket, :alpn_protocol, :cert, :cipher, :client_ca, :
|
31
|
+
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
|
32
32
|
|
33
33
|
wrap_blocking_method :accept, :accept_nonblock
|
34
34
|
wrap_blocking_method :connect, :connect_nonblock
|
@@ -73,11 +73,11 @@ module Async
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def self.wrap(socket, context)
|
76
|
+
io = @wrapped_klass.new(socket.to_io, context)
|
77
|
+
|
76
78
|
# We detach the socket from the reactor, otherwise it's possible to add the file descriptor to the selector twice, which is bad.
|
77
79
|
socket.reactor = nil
|
78
80
|
|
79
|
-
io = @wrapped_klass.new(socket.to_io, context)
|
80
|
-
|
81
81
|
# This ensures that when the internal IO is closed, it also closes the internal socket:
|
82
82
|
io.sync_close = true
|
83
83
|
|
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.8.
|
4
|
+
version: 1.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async
|