ractorize 0.0.11 → 0.0.13
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 +8 -0
- data/src/ractorize/ractorized_object.rb +4 -10
- data/src/ractorize/thunk.rb +2 -2
- data/src/ractorize.rb +0 -2
- 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: 2a50584e35561d9cbd2a8bb56ba1839714564eb44ebe7316d9395820f97b0eac
|
|
4
|
+
data.tar.gz: 821e4e5b1d2f6deed16320193d0066a7a51774fd29e9c7472320434b4143e986
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7d7fed909bba6d096618c20202c3421485e9de912c504546c70b27f4811e087c78eac25287aaeea4a867a95374b264cc69e922654b13afdbaa1f909a5c9b643e
|
|
7
|
+
data.tar.gz: 68c8f491a4b246b2078103ee815ef0f4dc18c9b84b3d428d46df62bc9f4361ff1ea9a82df6ab0d5706a054241756439e831ed745e9c0d0ea8e3767d8e1ffd206
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## [0.1.13] - 2026-08-13
|
|
2
|
+
|
|
3
|
+
- Calling methods with blocks no longer pre-emptively resolve thunks, avoiding potential deadlocks
|
|
4
|
+
|
|
5
|
+
## [0.0.12] - 2026-08-10
|
|
6
|
+
|
|
7
|
+
- Add ractor state to RactorizedObject#inspect
|
|
8
|
+
|
|
1
9
|
## [0.0.11] - 2026-07-31
|
|
2
10
|
|
|
3
11
|
- Log if a RactorizedRactor is taken down via ClosedError
|
|
@@ -24,12 +24,7 @@ module Ractorize
|
|
|
24
24
|
@__target_object_id__ = ::Object.instance_method(:object_id).bind_call(outside_object)
|
|
25
25
|
@__target_class__ = outside_object.class
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
@__ractor__ << outside_object
|
|
29
|
-
else
|
|
30
|
-
::Ractorize.resolve_all_thunks(outside_object)
|
|
31
|
-
@__ractor__.send(outside_object, move: true)
|
|
32
|
-
end
|
|
27
|
+
@__ractor__.send(outside_object, move: true)
|
|
33
28
|
when :class
|
|
34
29
|
klass, *args = args
|
|
35
30
|
|
|
@@ -139,14 +134,11 @@ module Ractorize
|
|
|
139
134
|
in :yield, [yielded_args, yielded_opts, yielded_block], block_result_port
|
|
140
135
|
# TODO: yielded_block likely won't work when actually used
|
|
141
136
|
# so we should probably instead just raise an exception
|
|
142
|
-
# TODO: handle break and also raise in the block
|
|
143
137
|
begin
|
|
144
138
|
broke = true
|
|
145
139
|
block_result = block.call(*yielded_args.freeze, **yielded_opts.freeze, &yielded_block)
|
|
146
140
|
broke = false
|
|
147
141
|
ensure
|
|
148
|
-
block_result = block_result.__value__ while ::Ractorize::Thunk === block_result
|
|
149
|
-
|
|
150
142
|
block_result_port << if broke
|
|
151
143
|
# TODO: handle error situation
|
|
152
144
|
:break
|
|
@@ -198,7 +190,9 @@ module Ractorize
|
|
|
198
190
|
# sometimes #inspect calls #inspect on other objects and can lead to reentry and thus deadlock
|
|
199
191
|
def inspect
|
|
200
192
|
object_id = ::Object.instance_method(:object_id).bind(self).call
|
|
201
|
-
"RactorizedObject<#{object_id}>[#{@__target_class__}<#{@__target_object_id__}>]}"
|
|
193
|
+
"RactorizedObject<#{object_id}>[#{@__target_class__}<#{@__target_object_id__}>]} #{__state__}"
|
|
202
194
|
end
|
|
195
|
+
|
|
196
|
+
def __state__ = @__ractor__.inspect[/ (\w+)>\z/, 1]
|
|
203
197
|
end
|
|
204
198
|
end
|
data/src/ractorize/thunk.rb
CHANGED
|
@@ -4,8 +4,8 @@ module Ractorize
|
|
|
4
4
|
|
|
5
5
|
attr_accessor :__thunk_ractor__, :__object_id__
|
|
6
6
|
|
|
7
|
-
def initialize(
|
|
8
|
-
self.__thunk_ractor__ =
|
|
7
|
+
def initialize(return_value_ractor)
|
|
8
|
+
self.__thunk_ractor__ = return_value_ractor
|
|
9
9
|
self.__object_id__ = ::Object.instance_method(:object_id).bind_call(self)
|
|
10
10
|
::Ractorize::GarbageCollection.track_thunk(self)
|
|
11
11
|
end
|
data/src/ractorize.rb
CHANGED