farce 0.3.0 → 0.4.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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +44 -0
  3. data/README.md +117 -1489
  4. data/docs/compatibility.md +74 -0
  5. data/docs/concurrency.md +151 -0
  6. data/docs/data-structures.md +313 -0
  7. data/docs/installation.md +63 -0
  8. data/docs/integrations.md +124 -0
  9. data/docs/introduction.md +266 -0
  10. data/docs/scheduling.md +176 -0
  11. data/docs/sharing.md +211 -0
  12. data/docs/shims.md +144 -0
  13. data/docs/utilities.md +93 -0
  14. data/docs/variants-and-scopes.md +92 -0
  15. data/lib/farce/abstract/flag.rb +6 -0
  16. data/lib/farce/backports.rb +274 -0
  17. data/lib/farce/engine/jruby/fiber_scheduler.rb +3 -0
  18. data/lib/farce/engine/jruby/scheduler_synchronization.rb +87 -0
  19. data/lib/farce/engine/ruby/3.4/null_port.rb +21 -0
  20. data/lib/farce/engine/ruby/3.4/patch.rb +67 -0
  21. data/lib/farce/engine/ruby/3.4/port.rb +13 -12
  22. data/lib/farce/engine/ruby/3.4/ractor_methods.rb +0 -1
  23. data/lib/farce/engine/ruby/4.0/null_port.rb +36 -0
  24. data/lib/farce/engine/ruby/4.0/port.rb +1 -2
  25. data/lib/farce/engine/ruby/4.1/null_port.rb +5 -0
  26. data/lib/farce/engine/ruby.rb +7 -0
  27. data/lib/farce/engine/shared/null_port.rb +18 -0
  28. data/lib/farce/engine/shared/port.rb +41 -3
  29. data/lib/farce/engine/shared/queue.rb +4 -4
  30. data/lib/farce/engine/shared/ractor_methods.rb +2 -2
  31. data/lib/farce/engine/shared/ractor_selector.rb +73 -0
  32. data/lib/farce/extension.rb +150 -0
  33. data/lib/farce/integrations/ractor_tmvar.rb +4 -1
  34. data/lib/farce/internal/fake_ractor.rb +10 -2
  35. data/lib/farce/internal/scheduler_lifecycle.rb +7 -4
  36. data/lib/farce/null_port.rb +12 -0
  37. data/lib/farce/system.rb +10 -2
  38. data/lib/farce/version.rb +1 -1
  39. data/lib/farce.rb +1 -1
  40. metadata +22 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 606351822ed0519ce92d1027233eec3295633e5107f7f94ac8649222fbb25fc1
4
- data.tar.gz: 4f896509b22bd8c18c2864dceda3c46bf8a49f412f88c31ee96eeb00956b9ddb
3
+ metadata.gz: a54fa924e64dc2414043e8b2593f6f977cb4a553f0b7fc9987dfffdb7ec9bbc3
4
+ data.tar.gz: ee1c903cd360e77f7ad7449708d57bf69e25ec8cec02b144ff138a4b1ab00095
5
5
  SHA512:
6
- metadata.gz: 7a0834837c23ed28d44af2a060b0f553f5d41cfdc46b976796cefc1fff5406b976e8358626f51ceabee55755b6589536e39db311c5aeb775077dfe1d99cb97d6
7
- data.tar.gz: d74c7e6c959fc09b97c8b5bff1d844b3623c9f698995a05d2f72be175a54f41b769b052287f0dea4e13b7ee97dca0dfcac5925260ee8a6b15443c95c67c20735
6
+ metadata.gz: fb0ba4de83addaf9f18c0316e9f325ed52f4d93ec6b81ffc500b6a332fe4fdf9a2d9a46fc5f17e5d011f881ca98e04569d433ecfa3add068fd9be6f3b28c2e7d
7
+ data.tar.gz: 12d9b698ae002087dbad1637af1c52993b56ffd1b001bcd1aa22c055099ba67cd7896fe8b3104561ee1b6a6fccdffa4bf6282ec63ba4b9daf8a5f538f0da2ed4
data/CHANGELOG.md CHANGED
@@ -4,6 +4,50 @@ Farce follows [Semantic Versioning 2.0](http://semver.org/). Any public method o
4
4
 
5
5
  ## Development Releases
6
6
 
7
+ ### Farce 0.4.0 (2026-10-16)
8
+
9
+ #### New Features
10
+
11
+ ##### Ractor Backports
12
+
13
+ `Farce::Backports` makes newer Ractor APIs available on older Ruby versions:
14
+
15
+ * Added `Ractor#default_port`, `#join`, `#monitor`, `#unmonitor`, and `#value` on Ruby versions prior to 4.0.
16
+ * Added `Ractor#alive?` on Ruby versions prior to 4.1.
17
+ * Added optional `timeout:` support for `Ractor.select`, `Ractor#receive`, and `Ractor::Port#receive` on Ruby versions prior to 4.1.
18
+
19
+ You can activate the backports for a lexical scope with `using Farce::Backports`, install them globally with `Farce::Backports.install`, or call methods on `Farce::Backports` directly.
20
+ Global installation also defines `Ractor` and `Ractor::Port` when they are not natively available.
21
+
22
+ ```ruby
23
+ using Farce::Backports
24
+
25
+ ractor = Farce::Ractor.new { 42 }
26
+ ractor.join
27
+ ractor.value # => 42
28
+ ```
29
+
30
+ ##### Ractor Improvements
31
+
32
+ * `Farce::Ractor.select` is now implemented on JRuby and TruffleRuby. It supports selecting from Ractors and ports, optional timeouts, and waiting without blocking a Fiber scheduler.
33
+ * The Ractor polyfill now supports `alive?` and follows Ruby 4.1's `monitor` notification format when running on Ruby 4.1 or later.
34
+
35
+ ##### Miscellaneous
36
+
37
+ * Added `set?` and `unset?` predicates to `Flag` and `Local::Flag`.
38
+ * Added `Farce::NULL_PORT`, a write-only port that discards messages and can be used to ignore Ractor exit notifications.
39
+ * Added `Farce::System.ruby_version`, which returns the current Ruby release as a version object without prerelease suffixes. It can be called from any Ractor.
40
+ * Added `Farce::Extension` to easily define modules that can be used both as refinements or installed globally into existing classes, used by `Farce::Backports`.
41
+
42
+ #### Bug Fixes
43
+
44
+ * Work around a JRuby synchronization race that could lose a mutex wakeup and leave a scheduled Fiber blocked.
45
+
46
+ #### Other changes
47
+
48
+ * Reorganized the README into a shorter introduction with topic-specific guides in the docs directory.
49
+ * Updated compatibility documentation and tests for `ractor-tmvar` 0.4.0.
50
+
7
51
  ### Farce 0.3.0 (2026-10-13)
8
52
 
9
53
  #### New Features