exceptional_synchrony 1.4.3 → 1.4.4
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/exceptional_synchrony/event_machine_proxy.rb +1 -1
- data/lib/exceptional_synchrony/version.rb +1 -1
- data/test/unit/event_machine_proxy_test.rb +4 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64473ec4185310154722e87211ea7c14db497e67d3f877a80b8fa260d0300453
|
4
|
+
data.tar.gz: 3f3c9d2a18c80120bde2264d515db9cf46d40e3177fc66ea5db15df65c4154f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b63d62a1d09d4976caca3a3c8c5734a8567a97910970042262cab2c11b71b7aa512bc53294222ec47a1cd60b2335085b9137a1de256696f238613cc79c39ee45
|
7
|
+
data.tar.gz: 488170dc367327780a3e6ccd494c05df45f75cfd2b7f1d16a293046c4012b87b63f92bcc9097414b2026a7d002f0236710ad35a54f35dcc90d09f311fb198b64
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ Note: This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0
|
|
6
6
|
|
7
7
|
All notable changes to this project will be documented in this file.
|
8
8
|
|
9
|
+
## [1.4.4] - 2022-03-25
|
10
|
+
### Changed
|
11
|
+
- Default unused defer(context) argument to nil.
|
12
|
+
|
9
13
|
## [1.4.3] - 2022-03-24
|
10
14
|
### Changed
|
11
15
|
- Update exception_handling
|
@@ -41,6 +45,7 @@ All notable changes to this project will be documented in this file.
|
|
41
45
|
## [1.1.1] - 2020-05-03
|
42
46
|
- Replace hobo_support with invoca_utils
|
43
47
|
|
48
|
+
[1.4.4]: https://github.com/Invoca/exceptional_synchrony/compare/v1.4.3...v1.4.4
|
44
49
|
[1.4.3]: https://github.com/Invoca/exceptional_synchrony/compare/v1.4.2...v1.4.3
|
45
50
|
[1.4.2]: https://github.com/Invoca/exceptional_synchrony/compare/v1.4.1...v1.4.2
|
46
51
|
[1.4.1]: https://github.com/Invoca/exceptional_synchrony/compare/v1.4.0...v1.4.1
|
data/Gemfile.lock
CHANGED
@@ -89,7 +89,7 @@ module ExceptionalSynchrony
|
|
89
89
|
# This method will execute the block on the background thread pool
|
90
90
|
# By default, it will block the caller until the background thread has finished, so that the result can be returned
|
91
91
|
# :wait_for_result - setting this to false will prevent the caller from being blocked by this deferred work
|
92
|
-
def defer(
|
92
|
+
def defer(_context = nil, wait_for_result: true, &block)
|
93
93
|
if wait_for_result
|
94
94
|
deferrable = EventMachine::DefaultDeferrable.new
|
95
95
|
callback = -> (result) { deferrable.succeed(result) }
|
@@ -102,7 +102,7 @@ describe ExceptionalSynchrony::EventMachineProxy do
|
|
102
102
|
|
103
103
|
it "should output its block's output when it doesn't raise an error, by default" do
|
104
104
|
@em.run do
|
105
|
-
assert_equal 12, @em.defer
|
105
|
+
assert_equal 12, @em.defer { 12 }
|
106
106
|
@em.stop
|
107
107
|
end
|
108
108
|
end
|
@@ -111,7 +111,7 @@ describe ExceptionalSynchrony::EventMachineProxy do
|
|
111
111
|
@block_ran = false
|
112
112
|
|
113
113
|
@em.run do
|
114
|
-
assert_nil @em.defer(
|
114
|
+
assert_nil @em.defer(wait_for_result: false) { @block_ran = true; 12 }
|
115
115
|
refute @block_ran
|
116
116
|
stop_em_after_defers_finish!(@em)
|
117
117
|
end
|
@@ -123,7 +123,7 @@ describe ExceptionalSynchrony::EventMachineProxy do
|
|
123
123
|
mock(ExceptionHandling).log_error(is_a(RuntimeError), "defer", {})
|
124
124
|
|
125
125
|
@em.run do
|
126
|
-
assert_nil @em.defer(
|
126
|
+
assert_nil @em.defer(wait_for_result: false) { raise RuntimeError, "error in defer" }
|
127
127
|
stop_em_after_defers_finish!(@em)
|
128
128
|
end
|
129
129
|
end
|
@@ -131,7 +131,7 @@ describe ExceptionalSynchrony::EventMachineProxy do
|
|
131
131
|
it "should raise an error when its block raises an error" do
|
132
132
|
@em.run do
|
133
133
|
ex = assert_raises(ArgumentError) do
|
134
|
-
@em.defer
|
134
|
+
@em.defer { raise ArgumentError, "!!!" }
|
135
135
|
end
|
136
136
|
|
137
137
|
assert_equal "!!!", ex.message
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exceptional_synchrony
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Invoca
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2014-01-16 00:00:00.000000000 Z
|
@@ -115,7 +115,7 @@ licenses:
|
|
115
115
|
metadata:
|
116
116
|
source_code_uri: https://github.com/Invoca/exceptional_synchrony
|
117
117
|
allowed_push_host: https://rubygems.org
|
118
|
-
post_install_message:
|
118
|
+
post_install_message:
|
119
119
|
rdoc_options: []
|
120
120
|
require_paths:
|
121
121
|
- lib
|
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
version: '0'
|
132
132
|
requirements: []
|
133
133
|
rubygems_version: 3.0.3
|
134
|
-
signing_key:
|
134
|
+
signing_key:
|
135
135
|
specification_version: 4
|
136
136
|
summary: Extensions to EventMachine/Synchrony to work well with exceptions
|
137
137
|
test_files: []
|