standard-procedure-async 0.2.1 → 0.2.2

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: 3aa258b93fc54c1232b652af7903b0fa85b4066aa09c442a4072c7d02d1fcf98
4
- data.tar.gz: ef18826e86e742dcf96ac784dd654cbc9d07ce7aa71859fed83e58f488b87eca
3
+ metadata.gz: ae90def8fcf35af35510635da2d65e967ae4233ea7fff7b8b9b5192efe681f0c
4
+ data.tar.gz: c19084657be08e00c3383f4dd67f36b1f53be2637a7af868f955369b169069c6
5
5
  SHA512:
6
- metadata.gz: 3c8168d2340e8e1ae2b5627f21c1f7a06adb0fb34845b4c1a4f0ba94e70fcd4609f2d502bd35441b0dd755ffc764a40e5ea69ae0949b20ddeb88a625bb8ea490
7
- data.tar.gz: c0236a569b587399f419fed3b02b1991fd5d3bcbd286e514ee232f79a66e6b899b4ffbe798c622a5201c69896e1f8b8cb313c47bda2d74c75c9eaee81425a1e7
6
+ metadata.gz: 24457a850f4bd6d67ebf0e221ffe7001fbcd2f383f4b151678a2e8fd64974a3c7078781419a11fab8239d3b762ca0c0a235864c788418c14f1336a028717e697
7
+ data.tar.gz: 217185e538e930352f32ba24cd4f88445733ff9b85f9501d1f702706ec8f9b9a4f4cd4088627a577ee77d9548bed5732fba1573c6c651307d24554204fc3e7db
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.2.2] - 2024-01-30
2
+
3
+ - raises an exception if the asynchronous method return an exception
4
+
1
5
  ## [0.2.1] - 2023-12-24
2
6
 
3
7
  - Bugfix: allow keyword arguments
@@ -55,7 +55,9 @@ module StandardProcedure
55
55
  # nodoc:
56
56
  class Message < Concurrent::ImmutableStruct.new(:target, :name, :args, :params, :block, :result)
57
57
  def value(timeout: 30)
58
- result.take(timeout)
58
+ result.take(timeout).tap do |value|
59
+ raise value if value.is_a? Exception
60
+ end
59
61
  end
60
62
  alias_method :get, :value
61
63
  alias_method :await, :value
@@ -1,5 +1,7 @@
1
1
  module Kernel
2
2
  def await &block
3
- block.call.value
3
+ block.call.value.tap do |result|
4
+ raise result if result.is_a? Exception
5
+ end
4
6
  end
5
7
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module StandardProcedure
4
4
  module Async
5
- VERSION = "0.2.1"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "lib/standard_procedure/async/version"
3
+ require_relative "lib/standard_procedure/async"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "standard-procedure-async"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard-procedure-async
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rahoul Baruah
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-30 00:00:00.000000000 Z
11
+ date: 2024-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby