async-io 1.30.2 → 1.31.0

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: 61a14845c7d079931211e6ac68687686d7be2408f53967980594d13a7e526036
4
- data.tar.gz: 6e6b66368d65a53f0ca0a313aab8a6857821d098c2c7316c8dae8d67329fa1c4
3
+ metadata.gz: a4bd452ecb8105b456fde28d2af79a2d4b360bac0cad9e7e35cc4f71c6c852d1
4
+ data.tar.gz: b629d8aed875e23295b8ab01da8b22c5f02a5fc79775a8afddae032531557d73
5
5
  SHA512:
6
- metadata.gz: c49e189437e5c89c011323cbc73c24c799d08e479b85fbf513a96f58b5732262085755750474a048e415a43e703bb78f28100f7a87ac7d506b966357d5d20d6a
7
- data.tar.gz: b65bfd71f89d9659dc5f30464c820df28a13b14294d7e4cb8ef432cd698b19fc09208a57f3ae2206c4c28db61ddbebfd0a334b9de50d0b89b3f28e621949cc63
6
+ metadata.gz: b905369d33bf79d557dcaee2a68ad24979295d64a746e7d05ae182a2cd00abba3db1c8d93e86e4eda525468ef3875adeb747cee9d95439e20a0246c49d9255f3
7
+ data.tar.gz: 5dba169bd0668e39aba12df17e53ee2f70a211be0b41e5fc6a9b5a1f0e59336b29ac534b67f40014410c70355753bc92be1951929bd6a36df9a166764e5a9c88
data/lib/async/io/peer.rb CHANGED
@@ -59,13 +59,13 @@ module Async
59
59
  when 0, IPPROTO_TCP
60
60
  self.setsockopt(IPPROTO_TCP, TCP_NODELAY, value ? 1 : 0)
61
61
  else
62
- Async.logger.warn(self) {"Unsure how to sync=#{value} for #{self.protocol}!"}
62
+ Console.logger.warn(self) {"Unsure how to sync=#{value} for #{self.protocol}!"}
63
63
  end
64
64
  rescue Errno::EINVAL
65
65
  # On Darwin, sometimes occurs when the connection is not yet fully formed. Empirically, TCP_NODELAY is enabled despite this result.
66
66
  rescue Errno::EOPNOTSUPP
67
67
  # Some platforms may simply not support the operation.
68
- # Async.logger.warn(self) {"Unable to set sync=#{value}!"}
68
+ # Console.logger.warn(self) {"Unable to set sync=#{value}!"}
69
69
  end
70
70
 
71
71
  def sync
@@ -116,7 +116,7 @@ module Async
116
116
  # @param remote_address [Address] The remote address to connect to.
117
117
  # @option local_address [Address] The local address to bind to before connecting.
118
118
  def self.connect(remote_address, local_address: nil, task: Task.current, **options)
119
- Async.logger.debug(self) {"Connecting to #{remote_address.inspect}"}
119
+ Console.logger.debug(self) {"Connecting to #{remote_address.inspect}"}
120
120
 
121
121
  task.annotate "connecting to #{remote_address.inspect}"
122
122
 
@@ -154,7 +154,7 @@ module Async
154
154
  # @param local_address [Address] The local address to bind to.
155
155
  # @option protocol [Integer] The socket protocol to use.
156
156
  def self.bind(local_address, protocol: 0, task: Task.current, **options, &block)
157
- Async.logger.debug(self) {"Binding to #{local_address.inspect}"}
157
+ Console.logger.debug(self) {"Binding to #{local_address.inspect}"}
158
158
 
159
159
  wrapper = build(local_address.afamily, local_address.socktype, protocol, **options) do |socket|
160
160
  socket.bind(local_address.to_sockaddr)
@@ -68,6 +68,7 @@ module Async
68
68
  super
69
69
  else
70
70
  io = self.class.wrapped_klass.new(socket.to_io, context)
71
+ super(io, socket.reactor)
71
72
 
72
73
  # We detach the socket from the reactor, otherwise it's possible to add the file descriptor to the selector twice, which is bad.
73
74
  socket.reactor = nil
@@ -75,10 +76,7 @@ module Async
75
76
  # This ensures that when the internal IO is closed, it also closes the internal socket:
76
77
  io.sync_close = true
77
78
 
78
- # Copy the timeout:
79
79
  @timeout = socket.timeout
80
-
81
- super(io, socket.reactor)
82
80
  end
83
81
  end
84
82
 
@@ -259,13 +259,13 @@ module Async
259
259
 
260
260
  if @read_buffer.empty?
261
261
  if @io.read_nonblock(size, @read_buffer, exception: false)
262
- # Async.logger.debug(self, name: "read") {@read_buffer.inspect}
262
+ # Console.logger.debug(self, name: "read") {@read_buffer.inspect}
263
263
  return true
264
264
  end
265
265
  else
266
266
  if chunk = @io.read_nonblock(size, @input_buffer, exception: false)
267
267
  @read_buffer << chunk
268
- # Async.logger.debug(self, name: "read") {@read_buffer.inspect}
268
+ # Console.logger.debug(self, name: "read") {@read_buffer.inspect}
269
269
 
270
270
  return true
271
271
  end
@@ -40,7 +40,7 @@ module Async
40
40
  # We do this unusual dance to avoid leaking an "open" socket instance.
41
41
  socket = Socket.connect(remote_address, local_address: local_address)
42
42
  fd = socket.fcntl(Fcntl::F_DUPFD)
43
- Async.logger.debug(self) {"Connected to #{remote_address.inspect}: #{fd}"}
43
+ Console.logger.debug(self) {"Connected to #{remote_address.inspect}: #{fd}"}
44
44
  socket.close
45
45
 
46
46
  super(::TCPSocket.for_fd(fd))
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Async
24
24
  module IO
25
- VERSION = "1.30.2"
25
+ VERSION = "1.31.0"
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.2
4
+ version: 1.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-09 00:00:00.000000000 Z
11
+ date: 2021-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async