core-async 0.5.0 → 0.6.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: 5449a66653642c9fa6f96c2a968bda754e31aefdee4c207d1e3a02e18e7e7dcb
4
- data.tar.gz: bc9e2ae806089f3a64cb3a3fa15d97505c5be54c0ca455577ddf3f6b1806f73b
3
+ metadata.gz: 32453e0ff3a28813b566b881be5fc88da0143249ac9164a332218a4c94799574
4
+ data.tar.gz: cb436adf5261d76f982b032996044ac379b1487b8e504a80641cc6c80aa5ba7a
5
5
  SHA512:
6
- metadata.gz: 7fe6d3f541fd066a958453573f027a70321f0176e3db0b1e3afdb414841bcb8d7367414ccc1aa6ae06b97437ef2fc299fee761ab88661470d69bd7cffd2d9c88
7
- data.tar.gz: a4786ac589bbb949c78ca6832e27b49abe79ed36b2b401529b0a56443404165e665d6f28aecdeeb9d1543e2f7e7c8ffba4ad05219fe5775e74d89fde750d2f9e
6
+ metadata.gz: 55253a5d64873e32794e5fa9fbc7497e1db49c99eeb0f673ce4ebdc70f33360ef547d5f676c1f13b3bef1f376493659305d1329753d758e5e3fd9ea0c20794c8
7
+ data.tar.gz: 80a4872f6d51426a1518f5b904413f5ed6296382a3d508268c04df3011bc7e28feb11f01f9df58e3998bc41db9afc53597a7d117df484f8eba35011aff019ce2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [v0.6.0](https://github.com/metabahn/corerb/releases/tag/2021-05-20)
2
+
3
+ *released on 2021-05-20*
4
+
5
+ * `fix` [#28](https://github.com/metabahn/corerb/pull/28) Turn off the console logger in all contexts ([bryanp](https://github.com/bryanp))
6
+ * `chg` [#27](https://github.com/metabahn/corerb/pull/27) Propagate throws from async contexts ([bryanp](https://github.com/bryanp))
7
+
1
8
  ## [v0.5.0](https://github.com/metabahn/corerb/releases/tag/2021-03-26)
2
9
 
3
10
  *released on 2021-03-26*
@@ -1,4 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "async"
4
- Console.logger.off!
4
+
5
+ # Turn the console logger off everywhere.
6
+ #
7
+ ENV["CONSOLE_LOGGER"] ||= "5"
@@ -40,6 +40,8 @@ module Core
40
40
  wait_all(@task)
41
41
 
42
42
  resolve_value(@task.result)
43
+ rescue UncaughtThrowError => error
44
+ throw error.tag, error.value
43
45
  rescue => error
44
46
  @error = error
45
47
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Core
4
4
  module Async
5
- VERSION = "0.5.0"
5
+ VERSION = "0.6.0"
6
6
 
7
7
  def self.version
8
8
  VERSION
data/lib/is/async.rb CHANGED
@@ -47,6 +47,8 @@ module Is
47
47
  }.result
48
48
  }.wait
49
49
  end
50
+ rescue UncaughtThrowError => error
51
+ throw error.tag, error.value
50
52
  end
51
53
 
52
54
  # [public] Call behavior within an async context without additional nesting.
@@ -73,16 +75,24 @@ module Is
73
75
  #
74
76
  # Raises `Core::Async::Timeout` if execution exceeds `seconds`.
75
77
  #
76
- private def timeout(seconds, &block)
78
+ private def timeout(seconds)
77
79
  internal_await do |task|
80
+ timed_task = internal_async {
81
+ yield
82
+ }
83
+
78
84
  if seconds && seconds > 0
79
85
  task.with_timeout(seconds, Core::Async::Timeout) do
80
- yield
86
+ timed_task.wait
81
87
  end
82
88
  else
83
- yield
89
+ timed_task.wait
84
90
  end
91
+ ensure
92
+ timed_task&.stop
85
93
  end
94
+ rescue UncaughtThrowError => error
95
+ throw error.tag, error.value
86
96
  end
87
97
 
88
98
  # [public] Yields control to allow other fibers to execute.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: core-async
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Powell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-26 00:00:00.000000000 Z
11
+ date: 2021-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -54,14 +54,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - ">="
56
56
  - !ruby/object:Gem::Version
57
- version: 2.5.0
57
+ version: 2.6.7
58
58
  required_rubygems_version: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  requirements: []
64
- rubygems_version: 3.2.4
64
+ rubygems_version: 3.2.15
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: Makes Ruby objects async-aware.