Skip to content

Commit 6265ada

Browse files
committed
Use Concurrent::Set for registry items
1 parent 70ed7ae commit 6265ada

4 files changed

Lines changed: 24 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
- Registry class to manage Cycle classes.
13+
- Use of Concurrent::Set for thread safety.
1314

1415
## [0.1.10] - 2025-09-04

Gemfile.lock

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,54 @@ PATH
33
specs:
44
sof-cycle (0.1.11)
55
activesupport (>= 6.0)
6+
concurrent-ruby (~> 1.0)
67
forwardable
78

89
GEM
910
remote: https://rubygems.org/
1011
specs:
11-
activesupport (7.1.5.2)
12+
activesupport (8.0.2.1)
1213
base64
1314
benchmark (>= 0.3)
1415
bigdecimal
15-
concurrent-ruby (~> 1.0, >= 1.0.2)
16+
concurrent-ruby (~> 1.0, >= 1.3.1)
1617
connection_pool (>= 2.2.5)
1718
drb
1819
i18n (>= 1.6, < 2)
1920
logger (>= 1.4.2)
2021
minitest (>= 5.1)
21-
mutex_m
2222
securerandom (>= 0.3)
23-
tzinfo (~> 2.0)
23+
tzinfo (~> 2.0, >= 2.0.5)
24+
uri (>= 0.13.1)
2425
ast (2.4.3)
2526
base64 (0.3.0)
2627
benchmark (0.4.1)
2728
bigdecimal (3.2.3)
28-
cgi (0.5.0)
2929
concurrent-ruby (1.3.5)
3030
connection_pool (2.5.4)
3131
date (3.4.1)
3232
debug (1.11.0)
3333
irb (~> 1.10)
3434
reline (>= 0.3.8)
3535
diff-lcs (1.6.2)
36-
docile (1.4.0)
36+
docile (1.4.1)
3737
drb (2.2.3)
38-
erb (4.0.4)
39-
cgi (>= 0.3.3)
38+
erb (5.0.2)
4039
forwardable (1.3.3)
4140
i18n (1.14.7)
4241
concurrent-ruby (~> 1.0)
43-
io-console (0.8.0)
42+
io-console (0.8.1)
4443
irb (1.15.2)
4544
pp (>= 0.6.0)
4645
rdoc (>= 4.0.0)
4746
reline (>= 0.4.2)
48-
json (2.12.2)
47+
json (2.13.2)
4948
language_server-protocol (3.17.0.5)
5049
lint_roller (1.1.0)
5150
logger (1.7.0)
5251
minitest (5.25.5)
53-
mutex_m (0.3.0)
5452
parallel (1.27.0)
55-
parser (3.3.8.0)
53+
parser (3.3.9.0)
5654
ast (~> 2.4.1)
5755
racc
5856
pp (0.6.2)
@@ -65,27 +63,27 @@ GEM
6563
racc (1.8.1)
6664
rainbow (3.1.1)
6765
rake (13.3.0)
68-
rdoc (6.14.1)
66+
rdoc (6.14.2)
6967
erb
7068
psych (>= 4.0.0)
71-
regexp_parser (2.10.0)
69+
regexp_parser (2.11.2)
7270
reissue (0.4.1)
7371
rake
74-
reline (0.6.1)
72+
reline (0.6.2)
7573
io-console (~> 0.5)
7674
rspec (3.13.1)
7775
rspec-core (~> 3.13.0)
7876
rspec-expectations (~> 3.13.0)
7977
rspec-mocks (~> 3.13.0)
80-
rspec-core (3.13.4)
78+
rspec-core (3.13.5)
8179
rspec-support (~> 3.13.0)
8280
rspec-expectations (3.13.5)
8381
diff-lcs (>= 1.2.0, < 2.0)
8482
rspec-support (~> 3.13.0)
8583
rspec-mocks (3.13.5)
8684
diff-lcs (>= 1.2.0, < 2.0)
8785
rspec-support (~> 3.13.0)
88-
rspec-support (3.13.4)
86+
rspec-support (3.13.5)
8987
rubocop (1.75.8)
9088
json (~> 2.3)
9189
language_server-protocol (~> 3.17.0.2)
@@ -97,20 +95,20 @@ GEM
9795
rubocop-ast (>= 1.44.0, < 2.0)
9896
ruby-progressbar (~> 1.7)
9997
unicode-display_width (>= 2.4.0, < 4.0)
100-
rubocop-ast (1.45.0)
98+
rubocop-ast (1.46.0)
10199
parser (>= 3.3.7.2)
102100
prism (~> 1.4)
103101
rubocop-performance (1.25.0)
104102
lint_roller (~> 1.1)
105103
rubocop (>= 1.75.0, < 2.0)
106104
rubocop-ast (>= 1.38.0, < 2.0)
107105
ruby-progressbar (1.13.0)
108-
securerandom (0.3.2)
106+
securerandom (0.4.1)
109107
simplecov (0.22.0)
110108
docile (~> 1.1)
111109
simplecov-html (~> 0.11)
112110
simplecov_json_formatter (~> 0.1)
113-
simplecov-html (0.12.3)
111+
simplecov-html (0.13.2)
114112
simplecov_json_formatter (0.1.4)
115113
standard (1.50.0)
116114
language_server-protocol (~> 3.17.0.2)
@@ -127,9 +125,10 @@ GEM
127125
stringio (3.1.7)
128126
tzinfo (2.0.6)
129127
concurrent-ruby (~> 1.0)
130-
unicode-display_width (3.1.4)
128+
unicode-display_width (3.1.5)
131129
unicode-emoji (~> 4.0, >= 4.0.4)
132130
unicode-emoji (4.0.4)
131+
uri (1.0.3)
133132

134133
PLATFORMS
135134
arm64-darwin-23

lib/sof/cycle_registry.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require "singleton"
2+
require "concurrent/set"
23

34
module SOF
45
class CycleRegistry
@@ -9,7 +10,7 @@ def register(cycle_class)
910
end
1011

1112
def cycle_classes
12-
@cycle_classes ||= Set.new
13+
@cycle_classes ||= Concurrent::Set.new
1314
end
1415

1516
def handling(kind)

sof-cycle.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ Gem::Specification.new do |spec|
3030

3131
spec.add_dependency "forwardable"
3232
spec.add_dependency "activesupport", ">= 6.0"
33+
spec.add_dependency "concurrent-ruby", "~> 1.0"
3334
end

0 commit comments

Comments
 (0)