async 2.16.0 → 2.17.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: c003b6b9a92bec85e7bae4b92956e62a0b71d7c862b0c31c4433384bdc72c8fc
4
- data.tar.gz: 4b401c016afe3359d1d5807194705e553e55550fb7387c0cba25dab4cbc0ba38
3
+ metadata.gz: a017a6f3304bf910379aeb0f16a40daa7fce7a3de0a3e56c97a359879a3910d1
4
+ data.tar.gz: '09a048a8b24b6779d23540f85ba8e5a1d6317d9cfc87f91e74af22960a21fd29'
5
5
  SHA512:
6
- metadata.gz: 4d4d8bcea59a6bb52a94dd80add548354ca2eb4f49e4cf986f45d9a81eea06b39852634b6d699cb387c793f1ad6b14a53f9ef0ccf008df1531f01219937cfe61
7
- data.tar.gz: eb67f96629b427458ea68da801e0cbc766dfdf12275c10f130cc14d379e97c369394dfe1d84f6dc33840e928e3d91649225e55716cfb3aa0245e3e6eaa2e1d51
6
+ metadata.gz: 415e7d9d23c06c60c752bb5b1ecbc336a98bd14b01b33c08bac56e4b8062b6b64761f4fcd8a412455705fb3908b715630beda5eaec7b62e3569e33cb37d235ea
7
+ data.tar.gz: 8f31cdb2fa5aded62f174683f7a5c62589191bd9263fc9c1d07c78c319592d47f4d3eb46cf92ac0f3005dad219756d16961a6a93823564de1e0263c4f1e70cb3
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/async/queue.rb CHANGED
@@ -38,12 +38,15 @@ module Async
38
38
  end
39
39
 
40
40
  # Add an item to the queue.
41
- def <<(item)
41
+ def push(item)
42
42
  @items << item
43
43
 
44
44
  @available.signal unless self.empty?
45
45
  end
46
46
 
47
+ # Compatibility with {::Queue#push}.
48
+ alias << push
49
+
47
50
  # Add multiple items to the queue.
48
51
  def enqueue(*items)
49
52
  @items.concat(items)
@@ -60,6 +63,9 @@ module Async
60
63
  @items.shift
61
64
  end
62
65
 
66
+ # Compatibility with {::Queue#pop}.
67
+ alias pop dequeue
68
+
63
69
  # Process each item in the queue.
64
70
  #
65
71
  # @asynchronous Executes the given block concurrently for each item.
@@ -241,7 +241,7 @@ module Async
241
241
  elsif timeout = get_timeout(io)
242
242
  # Otherwise, if we default to the io's timeout, we raise an exception:
243
243
  timer = @timers.after(timeout) do
244
- fiber.raise(::IO::TimeoutError, "Timeout while waiting for IO to become ready!")
244
+ fiber.raise(::IO::TimeoutError, "Timeout (#{timeout}s) while waiting for IO to become ready!")
245
245
  end
246
246
  end
247
247
 
@@ -256,7 +256,7 @@ module Async
256
256
 
257
257
  if timeout = get_timeout(io)
258
258
  timer = @timers.after(timeout) do
259
- fiber.raise(::IO::TimeoutError, "Timeout while waiting for IO to become readable!")
259
+ fiber.raise(::IO::TimeoutError, "Timeout (#{timeout}s) while waiting for IO to become readable!")
260
260
  end
261
261
  end
262
262
 
@@ -271,7 +271,7 @@ module Async
271
271
 
272
272
  if timeout = get_timeout(io)
273
273
  timer = @timers.after(timeout) do
274
- fiber.raise(::IO::TimeoutError, "Timeout while waiting for IO to become writable!")
274
+ fiber.raise(::IO::TimeoutError, "Timeout (#{timeout}s) while waiting for IO to become writable!")
275
275
  end
276
276
  end
277
277
 
data/lib/async/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2017-2024, by Samuel Williams.
5
5
 
6
6
  module Async
7
- VERSION = "2.16.0"
7
+ VERSION = "2.17.0"
8
8
  end
data/lib/kernel/async.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2022, by Samuel Williams.
4
+ # Copyright, 2019-2024, by Samuel Williams.
5
5
 
6
6
  require_relative "../async/reactor"
7
7
 
data/lib/kernel/sync.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2022, by Samuel Williams.
4
+ # Copyright, 2019-2024, by Samuel Williams.
5
5
  # Copyright, 2020, by Brian Morearty.
6
6
 
7
7
  require_relative "../async/reactor"
data/readme.md CHANGED
@@ -35,6 +35,8 @@ Please see the [project documentation](https://socketry.github.io/async/) for mo
35
35
 
36
36
  Please see the [project releases](https://socketry.github.io/async/releases/index) for all releases.
37
37
 
38
+ ### v2.17.0
39
+
38
40
  ### v2.16.0
39
41
 
40
42
  - [Better Handling of Async and Sync in Nested Fibers](https://socketry.github.io/async/releases/index#better-handling-of-async-and-sync-in-nested-fibers)
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v2.17.0
4
+
5
+ - Introduce `Async::Queue#push` and `Async::Queue#pop` for compatibility with `::Queue`.
6
+
3
7
  ## v2.16.0
4
8
 
5
9
  ### Better Handling of Async and Sync in Nested Fibers
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.16.0
4
+ version: 2.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -63,7 +63,7 @@ cert_chain:
63
63
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
64
64
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
65
65
  -----END CERTIFICATE-----
66
- date: 2024-08-23 00:00:00.000000000 Z
66
+ date: 2024-09-05 00:00:00.000000000 Z
67
67
  dependencies:
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: console
metadata.gz.sig CHANGED
Binary file