ratomic 0.2.0-aarch64-linux → 0.2.1-aarch64-linux

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4daad186ea78dee734a51a45058796088a136dc4581b2aca8069c1b537d18700
4
- data.tar.gz: 16eb668ab1e0a204fdf9d88d8e947d401782b1aa6662e0af6677a34d98e4e98a
3
+ metadata.gz: 5e1ecee0ea057050602abefbb051ed2cf5daa9ac44f7ab5de507645a1f4496fa
4
+ data.tar.gz: '0940a36aa2745313acd26b7d924d94c233c6a240d866d50eaa9ac9fd0549f3b0'
5
5
  SHA512:
6
- metadata.gz: 7d2f7ea9508fe6990a5b4da2f5309754da78b8a46193039155e9a9326a5411c32285c15dc0440bd159cbc1a50629e4765d3ad394fd25a497be68557e4f1fc827
7
- data.tar.gz: 26938fc5cd19ce5a71fdf70b156e6a945eaf151e091c70bca8ee95cd543bccd89111eea221992b00383113dc1829ffe7a7e988480267fe36250ac8143e9206bf
6
+ metadata.gz: 51fb89af866c1b1f4ebc97bcab4e65108e588b5b8acd508daa98276e84617bc3a41b225db8ea242e645d2d2538de817f6a0d321655fabc280b7f6cd71691fcbf
7
+ data.tar.gz: dcd37d8ee7b9631709246e5d9ba0fcfd34285d9eb6822787b914d981b68c9df4f8caca95aa4b278f6b425868fe83e0ef274f4a6411ea1a7c1903f1494c5ddb67
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.1] - 2026-06-04
4
+
5
+ - Fix `Ratomic::Queue` slot indexing for non-power-of-two capacities.
6
+ - Fix `Ratomic::Map#fetch_and_modify` to propagate block exceptions instead of panicking.
7
+
3
8
  ## [0.2.0] - 2026-06-04
4
9
 
5
10
  - Drop Ruby 3.x support and require Ruby 4.
data/README.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Ratomic
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/ratomic.svg)](https://badge.fury.io/rb/ratomic)
4
+ [![CI](https://github.com/mperham/ratomic/workflows/CI/badge.svg)](https://github.com/mperham/ratomic/actions)
5
+ [![Coverage Status](https://codecov.io/gh/mperham/ratomic/branch/main/graph/badge.svg)](https://codecov.io/gh/mperham/ratomic)
6
+ [![Ruby Version](https://img.shields.io/badge/ruby-%3E%3D%204.0-ruby.svg)](https://www.ruby-lang.org/en/)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+
9
+
3
10
  Ratomic provides mutable data structures for use with Ruby's Ractors.
4
11
  This allows Ruby code to scale beyond the infamous GVL.
5
12
 
@@ -31,8 +38,6 @@ Install the gem and add to the application's Gemfile by executing:
31
38
  bundle add ratomic
32
39
  ```
33
40
 
34
- TODO: We have not released a gem yet.
35
-
36
41
  ## Usage
37
42
 
38
43
  Ratomic provides several useful Ractor-safe structures.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
data/lib/ratomic/pool.rb CHANGED
@@ -73,6 +73,20 @@ module Ratomic
73
73
  nil
74
74
  end
75
75
 
76
+ # Stop the private coordinator Ractor.
77
+ #
78
+ # This is primarily useful for tests and short-lived scripts. A closed pool
79
+ # should not be used for further checkout/checkin operations.
80
+ #
81
+ # @return [nil]
82
+ def close
83
+ @control << [:shutdown]
84
+ @control.value
85
+ nil
86
+ rescue Ractor::ClosedError, Ractor::Error
87
+ nil
88
+ end
89
+
76
90
  # Checkout an object, yield it, then move it back to the pool.
77
91
  #
78
92
  # This is the preferred API because it guarantees checkin through an ensure
@@ -101,7 +115,7 @@ module Ratomic
101
115
 
102
116
  loop do
103
117
  command, *args = Ractor.receive
104
- handle_command(command, args, available, waiting)
118
+ break if handle_command(command, args, available, waiting) == :shutdown
105
119
  end
106
120
  end
107
121
  private_class_method :run_control_loop
@@ -114,6 +128,8 @@ module Ratomic
114
128
  handle_checkin(args.fetch(0), available, waiting)
115
129
  when :cancel
116
130
  waiting.delete(args.fetch(0))
131
+ when :shutdown
132
+ :shutdown
117
133
  end
118
134
  end
119
135
  private_class_method :handle_command
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ratomic
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ratomic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Mike Perham