async-io 1.38.0 → 1.39.0

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
  SHA256:
3
- metadata.gz: 3b7b3f7b1f99d0f76bb82952decb91db243b03701816487be7994fe21a44a367
4
- data.tar.gz: 3d4fb5452bad6c72e0dfcc05a0e29ab3711007b87b2bca0962cec3d1dc8126b0
3
+ metadata.gz: 35ab781a6326f6ba8743f953608e78b6bfc95de508667cc6a07999e2f0564607
4
+ data.tar.gz: b77dcb0fc4ede58d173be22808e040fb17f79228263cf7b8be7cb758e54d2638
5
5
  SHA512:
6
- metadata.gz: 53585eab5d5b7713182f47a030beaddbcccc77faf3bdb8f90d5d7d178167dcf63f627580225e813558da9ac61cbe5f9d005d0787666ef566e34deb527fedd79a
7
- data.tar.gz: cef5bfceb64437f36cdd4c8391705ba9fcb10c754c96eebab8a3dc0eaabf3e819054e229d38d2f72763e36bc2d2791cc635652219e01ec3baf07b3bacaf22d7d
6
+ metadata.gz: fff9ad34a8396466dadfb4d8a96b9d8aeb1601219b0586aa248ef7907894e4f2f795453f48e8337f07675f8d7092fdb460d4692d8082439b2fa6df6d7023ca4c
7
+ data.tar.gz: 69dd0d6fd8d17c4768ff75d1f5fd29939e454b96735b98c94fef47f5deeb515d6193517f56a8c7c4457238e18630fa0d8db423e7e76dc4562be6a24349891a1d
checksums.yaml.gz.sig CHANGED
Binary file
@@ -78,23 +78,6 @@ module Async
78
78
  end
79
79
  end
80
80
 
81
- # Map all endpoints by invoking `#bind`.
82
- # @yield the bound wrapper.
83
- def bound
84
- wrappers = []
85
-
86
- self.each do |endpoint|
87
- wrapper = endpoint.bind
88
- wrappers << wrapper
89
-
90
- yield wrapper
91
- end
92
-
93
- return wrappers
94
- ensure
95
- wrappers.each(&:close) if $!
96
- end
97
-
98
81
  # Create an Endpoint instance by URI scheme. The host and port of the URI will be passed to the Endpoint factory method, along with any options.
99
82
  #
100
83
  # @param string [String] URI as string. Scheme will decide implementation used.
@@ -169,7 +169,7 @@ module Async
169
169
  when :write
170
170
  wait_writable(timeout)
171
171
  else
172
- wait_any(:rw, timeout)
172
+ wait_any(timeout)
173
173
  end
174
174
  rescue TimeoutError
175
175
  return nil
@@ -12,8 +12,10 @@ module Async
12
12
  # Pre-connect and pre-bind sockets so that it can be used between processes.
13
13
  class SharedEndpoint < Endpoint
14
14
  # Create a new `SharedEndpoint` by binding to the given endpoint.
15
- def self.bound(endpoint, backlog: Socket::SOMAXCONN, close_on_exec: false)
16
- wrappers = endpoint.bound do |server|
15
+ def self.bound(endpoint, backlog: Socket::SOMAXCONN, close_on_exec: false, **options)
16
+ sockets = Array(endpoint.bind(**options))
17
+
18
+ wrappers = sockets.each do |server|
17
19
  # This is somewhat optional. We want to have a generic interface as much as possible so that users of this interface can just call it without knowing a lot of internal details. Therefore, we ignore errors here if it's because the underlying socket does not support the operation.
18
20
  begin
19
21
  server.listen(backlog)
@@ -117,5 +119,15 @@ module Async
117
119
  "\#<#{self.class} #{@wrappers.size} descriptors for #{@endpoint}>"
118
120
  end
119
121
  end
122
+
123
+ class Endpoint
124
+ def bound(**options)
125
+ SharedEndpoint.bound(self, **options)
126
+ end
127
+
128
+ def connected(**options)
129
+ SharedEndpoint.connected(self, **options)
130
+ end
131
+ end
120
132
  end
121
133
  end
@@ -65,7 +65,9 @@ module Async
65
65
  yield SSLServer.new(server, context)
66
66
  end
67
67
  else
68
- return SSLServer.new(@endpoint.bind, context)
68
+ @endpoint.bind.map do |server|
69
+ SSLServer.new(server, context)
70
+ end
69
71
  end
70
72
  end
71
73
 
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module IO
8
- VERSION = "1.38.0"
8
+ VERSION = "1.39.0"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-io
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.38.0
4
+ version: 1.39.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -46,7 +46,7 @@ cert_chain:
46
46
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
47
47
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
48
48
  -----END CERTIFICATE-----
49
- date: 2023-11-17 00:00:00.000000000 Z
49
+ date: 2024-01-22 00:00:00.000000000 Z
50
50
  dependencies:
51
51
  - !ruby/object:Gem::Dependency
52
52
  name: async
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  - !ruby/object:Gem::Version
204
204
  version: '0'
205
205
  requirements: []
206
- rubygems_version: 3.4.10
206
+ rubygems_version: 3.4.22
207
207
  signing_key:
208
208
  specification_version: 4
209
209
  summary: Provides support for asynchonous TCP, UDP, UNIX and SSL sockets.
metadata.gz.sig CHANGED
Binary file