async 2.10.1 → 2.11.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: 80ec5a3027f34138e334db424a42fcf0d424b11d5100527d5e2f8f07534ce33c
4
- data.tar.gz: 915d39b6b115479c019d8ee0060115d3d1315f8ea864db83887cb158eafe3d2c
3
+ metadata.gz: 43ab9833acc38ebf7eff4ef5e37401c5d9aff7f668eb71e77547666c1ddee9b8
4
+ data.tar.gz: f18b2eec51ff8bb163b91e6ed5583a8bbbbc0a985ff35738ae0c79aa37913687
5
5
  SHA512:
6
- metadata.gz: 99ae4f68d7aa9ccacc9bb73d80faa687d2c869a61749efadb23bf7f7af1738998f452bccebf18fe2f85af00c456ea31d03cb3e8b822138263064645cd11c1100
7
- data.tar.gz: 667c747343c640256e6df33bec66a6f05202dd11ed7023e06c8c0b6831c171a468c7558c4d771d644e11765d8071203c1e5f0e490383cdb18269022b39cb7135
6
+ metadata.gz: f07fafe843aea1930627b51f1dd4ba3c0a698f960282381a09c6955a79aeb5ab774d0f89b9680a4cf9bd84fa15c8a50fe9b2bce8bce0c5e6f0e655cbfe39988e
7
+ data.tar.gz: b4ec7cfe3d51ed349f72993b862a01738341a0603833df75188dd8a43d714e1b1ede85f97bcbaebe17027a4cd1992d1cb617d41d4773b04da447080701e94a71
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/async/barrier.md CHANGED
@@ -9,7 +9,7 @@ require 'async/barrier'
9
9
 
10
10
  barrier = Async::Barrier.new
11
11
  Sync do
12
- Console.logger.info("Barrier Example: sleep sort.")
12
+ Console.info("Barrier Example: sleep sort.")
13
13
 
14
14
  # Generate an array of 10 numbers:
15
15
  numbers = 10.times.map{rand(10)}
@@ -26,7 +26,7 @@ Sync do
26
26
  # Wait for all the numbers to be sorted:
27
27
  barrier.wait
28
28
 
29
- Console.logger.info("Sorted", sorted)
29
+ Console.info("Sorted", sorted)
30
30
  ensure
31
31
  # Ensure all the tasks are stopped when we exit:
32
32
  barrier.stop
@@ -9,14 +9,14 @@ Sync do
9
9
  condition = Async::Condition.new
10
10
 
11
11
  Async do
12
- Console.logger.info "Waiting for condition..."
12
+ Console.info "Waiting for condition..."
13
13
  value = condition.wait
14
- Console.logger.info "Condition was signalled: #{value}"
14
+ Console.info "Condition was signalled: #{value}"
15
15
  end
16
16
 
17
17
  Async do |task|
18
18
  task.sleep(1)
19
- Console.logger.info "Signalling condition..."
19
+ Console.info "Signalling condition..."
20
20
  condition.signal("Hello World")
21
21
  end
22
22
  end
@@ -369,7 +369,7 @@ module Async
369
369
 
370
370
  return initial_task
371
371
  ensure
372
- Console.logger.debug(self) {"Exiting run-loop because #{$! ? $! : 'finished'}."}
372
+ Console.debug(self) {"Exiting run-loop because #{$! ? $! : 'finished'}."}
373
373
  end
374
374
 
375
375
  # Start an asynchronous task within the specified reactor. The task will be
@@ -395,7 +395,7 @@ module Async
395
395
  # - Avoid scheduler overhead if no blocking operation is performed.
396
396
  task.run(*arguments)
397
397
 
398
- # Console.logger.debug "Initial execution of task #{fiber} complete (#{result} -> #{fiber.alive?})..."
398
+ # Console.debug "Initial execution of task #{fiber} complete (#{result} -> #{fiber.alive?})..."
399
399
  return task
400
400
  end
401
401
 
@@ -17,9 +17,9 @@ Sync do
17
17
  # Search for the terms:
18
18
  terms.each do |term|
19
19
  semaphore.async do |task|
20
- Console.logger.info("Searching for #{term}...")
20
+ Console.info("Searching for #{term}...")
21
21
  response = Net::HTTP.get(URI "https://www.google.com/search?q=#{term}")
22
- Console.logger.info("Got response #{response.size} bytes.")
22
+ Console.info("Got response #{response.size} bytes.")
23
23
  end
24
24
  end
25
25
  end
data/lib/async/task.rb CHANGED
@@ -8,6 +8,7 @@
8
8
  # Copyright, 2023, by Math Ieu.
9
9
 
10
10
  require 'fiber'
11
+ require 'console/event/failure'
11
12
 
12
13
  require_relative 'node'
13
14
  require_relative 'condition'
@@ -335,15 +336,15 @@ module Async
335
336
  raise exception
336
337
  elsif @finished.nil?
337
338
  # If no one has called wait, we log this as a warning:
338
- Console.logger.warn(self, "Task may have ended with unhandled exception.", exception)
339
+ Console::Event::Failure.for(exception).emit(self, "Task may have ended with unhandled exception.", severity: :warn)
339
340
  else
340
- Console.logger.debug(self, exception)
341
+ Console::Event::Failure.for(exception).emit(self, severity: :debug)
341
342
  end
342
343
  end
343
344
  end
344
345
 
345
346
  def stopped!
346
- # Console.logger.info(self, status:) {"Task #{self} was stopped with #{@children&.size.inspect} children!"}
347
+ # Console.info(self, status:) {"Task #{self} was stopped with #{@children&.size.inspect} children!"}
347
348
  @status = :stopped
348
349
 
349
350
  stopped = false
@@ -374,7 +375,7 @@ module Async
374
375
 
375
376
  begin
376
377
  completed!(yield)
377
- # Console.logger.debug(self) {"Task was completed with #{@children.size} children!"}
378
+ # Console.debug(self) {"Task was completed with #{@children.size} children!"}
378
379
  rescue Stop
379
380
  stopped!
380
381
  rescue StandardError => error
@@ -382,7 +383,7 @@ module Async
382
383
  rescue Exception => exception
383
384
  failed!(exception, true)
384
385
  ensure
385
- # Console.logger.info(self) {"Task ensure $! = #{$!} with #{@children&.size.inspect} children!"}
386
+ # Console.info(self) {"Task ensure $! = #{$!} with #{@children&.size.inspect} children!"}
386
387
  finish!
387
388
  end
388
389
  end
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.10.1"
7
+ VERSION = "2.11.0"
8
8
  end
data/lib/async/waiter.md CHANGED
@@ -38,7 +38,7 @@ Sync do
38
38
  # Stop all tasks which we don't care about:
39
39
  barrier.stop
40
40
 
41
- Console.logger.info("Smallest", numbers)
41
+ Console.info("Smallest", numbers)
42
42
  end
43
43
  ~~~
44
44
 
data/license.md CHANGED
@@ -25,6 +25,7 @@ Copyright, 2023, by Colin Kelley.
25
25
  Copyright, 2023, by Math Ieu.
26
26
  Copyright, 2023, by Emil Tin.
27
27
  Copyright, 2023, by Gert Goet.
28
+ Copyright, 2024, by Dimitar Peychinov.
28
29
 
29
30
  Permission is hereby granted, free of charge, to any person obtaining a copy
30
31
  of this software and associated documentation files (the "Software"), to deal
data/readme.md CHANGED
@@ -20,7 +20,7 @@ Async is a composable asynchronous I/O framework for Ruby based on [io-event](ht
20
20
 
21
21
  Please see the [project documentation](https://socketry.github.io/async/) for more details.
22
22
 
23
- - [Getting Started](https://socketry.github.io/async/guides/getting-started/index) - This guide gives shows how to add
23
+ - [Getting Started](https://socketry.github.io/async/guides/getting-started/index) - This guide shows how to add
24
24
  async to your project and run code asynchronously.
25
25
 
26
26
  - [Asynchronous Tasks](https://socketry.github.io/async/guides/asynchronous-tasks/index) - This guide explains how
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.10.1
4
+ version: 2.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -13,6 +13,7 @@ authors:
13
13
  - Kent Gruber
14
14
  - Brian Morearty
15
15
  - Colin Kelley
16
+ - Dimitar Peychinov
16
17
  - Gert Goet
17
18
  - Jiang Jinyang
18
19
  - Julien Portalier
@@ -61,7 +62,7 @@ cert_chain:
61
62
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
62
63
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
63
64
  -----END CERTIFICATE-----
64
- date: 2024-03-27 00:00:00.000000000 Z
65
+ date: 2024-05-04 00:00:00.000000000 Z
65
66
  dependencies:
66
67
  - !ruby/object:Gem::Dependency
67
68
  name: console
@@ -69,14 +70,20 @@ dependencies:
69
70
  requirements:
70
71
  - - "~>"
71
72
  - !ruby/object:Gem::Version
72
- version: '1.10'
73
+ version: '1.25'
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: 1.25.2
73
77
  type: :runtime
74
78
  prerelease: false
75
79
  version_requirements: !ruby/object:Gem::Requirement
76
80
  requirements:
77
81
  - - "~>"
78
82
  - !ruby/object:Gem::Version
79
- version: '1.10'
83
+ version: '1.25'
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: 1.25.2
80
87
  - !ruby/object:Gem::Dependency
81
88
  name: fiber-annotation
82
89
  requirement: !ruby/object:Gem::Requirement
@@ -163,6 +170,7 @@ licenses:
163
170
  metadata:
164
171
  documentation_uri: https://socketry.github.io/async/
165
172
  funding_uri: https://github.com/sponsors/ioquatix/
173
+ source_code_uri: https://github.com/socketry/async.git
166
174
  post_install_message:
167
175
  rdoc_options: []
168
176
  require_paths:
metadata.gz.sig CHANGED
Binary file