ractorize 0.0.13 → 0.0.14
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 -1
- data/src/ractorize/ractorized_object/ractorized_ractor.rb +0 -1
- data/src/ractorize/ractorized_object.rb +11 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f251a64914d48582cef7e7de71c90217876aa54ee9cd5cf8aa0996c66eab3227
|
|
4
|
+
data.tar.gz: bf79ddf44caef84da4c0875982b4bee2ad32b0f9ee94e84e3cadb89fa98bab08
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b0efea3eeca4d2cc3c0e24c750c421a916d4f8d6540f9927f7d0ccbeef12ca4527aab0ec613f6412cd2ad131f30c19e7c6a5626d80ddbb4df1e3ba6839b7acfd
|
|
7
|
+
data.tar.gz: 807689cc00cc2e2186f2b094d0a1dd6f4f8d436599bfd46d0de08e08193ace7400502dd9e358f39b146e53593e93198cac31614bbc79fb30b131915bd3b31690
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
## [0.
|
|
1
|
+
## [0.0.14] - 2026-08-14
|
|
2
|
+
|
|
3
|
+
- Make sure thunks are dethunked in predicate contexts involving blocks or chains of thunks
|
|
4
|
+
|
|
5
|
+
## [0.0.13] - 2026-08-13
|
|
2
6
|
|
|
3
7
|
- Calling methods with blocks no longer pre-emptively resolve thunks, avoiding potential deadlocks
|
|
4
8
|
|
|
@@ -88,7 +88,10 @@ module Ractorize
|
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
return_port = ::Ractorize::RactorizedObject::RactorizedRactor::Port.new
|
|
91
|
-
|
|
91
|
+
|
|
92
|
+
can_use_thunk = RactorizedObject.method_should_use_thunk?(method_name)
|
|
93
|
+
|
|
94
|
+
thunk_ractor = if !block && can_use_thunk
|
|
92
95
|
::Ractorize::Thunk::ThunkRactor.new
|
|
93
96
|
end
|
|
94
97
|
|
|
@@ -149,6 +152,11 @@ module Ractorize
|
|
|
149
152
|
end
|
|
150
153
|
end
|
|
151
154
|
|
|
155
|
+
unless can_use_thunk
|
|
156
|
+
# It's important we don't accidentally return a thunk (truthy) instead of nil/false (falsey)
|
|
157
|
+
value = value.__value__ while ::Ractorize::Thunk === value
|
|
158
|
+
end
|
|
159
|
+
|
|
152
160
|
value
|
|
153
161
|
# Let's assume the user would rather block on all predicate methods than
|
|
154
162
|
# incorrectly get a non-truthy value (thunk is always truthy even if it evaluates as nil/false)
|
|
@@ -159,9 +167,8 @@ module Ractorize
|
|
|
159
167
|
value = return_port.receive
|
|
160
168
|
return_port.close
|
|
161
169
|
|
|
162
|
-
#
|
|
163
|
-
|
|
164
|
-
# simplecov:enable
|
|
170
|
+
# It's important we don't accidentally return a thunk (truthy) instead of nil/false (falsey)
|
|
171
|
+
value = value.__value__ while ::Ractorize::Thunk === value
|
|
165
172
|
|
|
166
173
|
value
|
|
167
174
|
end
|