async 2.20.0 → 2.21.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: 920118919742122dff3aac0288b03f26a34ede0fddbe1cca028782061780d6b3
4
- data.tar.gz: 9e292ef0a389ec607b9fdbbf86d64ea68cfc44e040eda784e067211ff3cd7b79
3
+ metadata.gz: 4a5bc2e233137c26a571123a0edc0cd22fe32278f780fe801c166a2c7968dc83
4
+ data.tar.gz: 2c2aab55da8cfe72e2806a6bb1e4a18e3b20d7162ff929bcb91de019eb9c6da3
5
5
  SHA512:
6
- metadata.gz: a56d10905b2165753f18c80d6763e58fadf575ccddc4aca391082e7a354a131cdd7edcb635cd09927a216049d4051f2947d777f496e4bed87ea6bb64143fbecd
7
- data.tar.gz: 787cdea5aef8460d8a410216c56550210fd4639586c6b8c89e9190a247d979171da45054d83516f3b6f864ba0b202d1b581bc16cc0653ed853a20342363b3982
6
+ metadata.gz: 9f3490b820e58aa4e6a3a95051bc36b699903f617918832f557b4a3369c7101a9c36cf878b34ab274caa1379591c30fef0f56cac79dbf1da482b16472c9cde1d
7
+ data.tar.gz: 8c911bdb5a50dadc299ee4d7ed0cd6d16371b84fe622fb1542190fc5a586f914dca4a5396de481f826c8606d547df831357f783f3ee67da3de18e49dd5ad7dd6
checksums.yaml.gz.sig CHANGED
Binary file
@@ -338,6 +338,25 @@ module Async
338
338
  return @selector.process_wait(Fiber.current, pid, flags)
339
339
  end
340
340
 
341
+ # Wait for the given work to be executed.
342
+ #
343
+ # @public Since *Async v2.19* and *Ruby v3.4*.
344
+ # @asynchronous May be non-blocking.
345
+ #
346
+ # @parameter work [Proc] The work to execute on a background thread.
347
+ # @returns [Object] The result of the work.
348
+ def blocking_operation_wait(work)
349
+ thread = Thread.new(&work)
350
+
351
+ result = thread.join
352
+
353
+ thread = nil
354
+
355
+ return result
356
+ ensure
357
+ thread&.kill
358
+ end
359
+
341
360
  # Run one iteration of the event loop.
342
361
  #
343
362
  # When terminating the event loop, we already know we are finished. So we don't need to check the task tree. This is a logical requirement because `run_once` ignores transient tasks. For example, a single top level transient task is not enough to keep the reactor running, but during termination we must still process it in order to terminate child tasks.
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.20.0"
7
+ VERSION = "2.21.0"
8
8
  end
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.20.0
4
+ version: 2.21.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-11-10 00:00:00.000000000 Z
66
+ date: 2024-11-21 00:00:00.000000000 Z
67
67
  dependencies:
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: console
metadata.gz.sig CHANGED
Binary file