ractor-wrapper 0.4.0 → 0.5.0
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/.yardopts +1 -0
- data/CHANGELOG.md +5 -0
- data/CLAUDE.md +5 -2
- data/DESIGN.md +1024 -0
- data/README.md +59 -42
- data/lib/ractor/wrapper/version.rb +1 -1
- data/lib/ractor/wrapper.rb +576 -66
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0c9842a8f90ab6b20838f2f79a5b70dd63caf6dd895bb933c116f44f9d994079
|
|
4
|
+
data.tar.gz: 496a5dbd7b8f62aeb889c34e48adb09ec879fc2c382cea8192cf7935a6fec237
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 20fb9f04c4824370c120133c72a8927f1131aab29bf134b367b2afc36c19b5be8b42e864ec776f437bd7424b39203c9524a31972a8e4633e2f5915d03168c513
|
|
7
|
+
data.tar.gz: 07d84754548dfc770381aa517812f9d702ae5b7f1ccaea0ec36f7fc8be3a8049080606ba52d34f47b4749d1665f8a06a992a97a394e5ca2c17e08c92672fbc20
|
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Release History
|
|
2
2
|
|
|
3
|
+
### v0.5.0 / 2026-04-26
|
|
4
|
+
|
|
5
|
+
* ADDED: Reworked server flow to use fibers, to reduce deadlocks on nested calls
|
|
6
|
+
* DOCS: Added design doc
|
|
7
|
+
|
|
3
8
|
### v0.4.0 / 2026-03-30
|
|
4
9
|
|
|
5
10
|
This release includes two major changes: it greatly improves robustness in the case of server crashes, and it reworks the method call configuration interface. This involves several breaking changes, and I expect the interface will continue to be a bit unstable for now as I'm working through use cases and edge cases. The README has also been expanded to include more information on the configuration options and the known issues.
|
data/CLAUDE.md
CHANGED
|
@@ -29,7 +29,7 @@ The entire library lives in `lib/ractor/wrapper.rb`. The public entry point is `
|
|
|
29
29
|
- **`Ractor::Wrapper`** — Public API. Wraps an object and manages its lifecycle. Accepts options like `use_current_ractor:`, `threads:`, `name:`, and per-method settings via `configure_method`.
|
|
30
30
|
- **`Ractor::Wrapper::Stub`** — Frozen, shareable proxy passed to other Ractors. Uses `method_missing` to forward calls back to the wrapper via message passing.
|
|
31
31
|
- **`Ractor::Wrapper::MethodSettings`** — Frozen configuration controlling copy vs. move semantics for arguments and return values, and block handling behavior.
|
|
32
|
-
- **`Ractor::Wrapper::Server`** — Private backend. Receives `CallMessage` objects and dispatches them to the wrapped object, then returns results via `ReturnMessage`, `ExceptionMessage`, or `
|
|
32
|
+
- **`Ractor::Wrapper::Server`** — Private backend. Receives `CallMessage` objects and dispatches them to the wrapped object, then returns results via `ReturnMessage`, `ExceptionMessage`, or one of the yield message types (`FiberYieldMessage` or `BlockingYieldMessage`).
|
|
33
33
|
|
|
34
34
|
### Two execution modes
|
|
35
35
|
|
|
@@ -43,7 +43,10 @@ The entire library lives in `lib/ractor/wrapper.rb`. The public entry point is `
|
|
|
43
43
|
|
|
44
44
|
### Message protocol
|
|
45
45
|
|
|
46
|
-
All inter-Ractor communication uses frozen message structs defined in the file: `CallMessage`, `ReturnMessage`, `ExceptionMessage`, `
|
|
46
|
+
All inter-Ractor communication uses frozen message structs defined in the file: `CallMessage`, `ReturnMessage`, `ExceptionMessage`, `FiberYieldMessage`, `BlockingYieldMessage`, `FiberReturnMessage`, `FiberExceptionMessage`, `StopMessage`, `JoinMessage`, `WorkerStoppedMessage`. Block calls round-trip via one of two paths:
|
|
47
|
+
|
|
48
|
+
- **Fiber-suspend path** (most cases): the server sends a `FiberYieldMessage` (carrying the `fiber_id` of the suspended method-handling fiber) to the caller Ractor. The caller executes the block and sends a `FiberReturnMessage` or `FiberExceptionMessage` back to the server's main port; the main loop looks up the fiber by id and resumes it with the reply.
|
|
49
|
+
- **Blocking-fallback path** (nested-fiber/spawned-thread cases): the server allocates a temporary reply port, sends a `BlockingYieldMessage` carrying that port, and blocks on it. The caller responds with a `ReturnMessage` or `ExceptionMessage` directly to that temporary port. This path can deadlock under re-entrant calls but is preserved where the fiber-suspend path is not safe.
|
|
47
50
|
|
|
48
51
|
### Lifecycle
|
|
49
52
|
|