ractor-pool 0.4.0 → 0.4.1

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: 2d8741738f0de76db49cbbbaccc701b687af3df13ce9802205c7661a10519126
4
- data.tar.gz: 337ce4d26b7735ec2517c2b88e76f2b11bef87124e3581a74772e68fbd3b6e57
3
+ metadata.gz: faa7b2eb7fcac31583654e4122f532ae419fb009c8fbd5a42f1ddae61c3481c1
4
+ data.tar.gz: 98bd5aee0bfbf16c36afa9112b1fde3fa9470b42dbc01792559f04278725b510
5
5
  SHA512:
6
- metadata.gz: 663d3b28aeab7e0341bbfd5d78540c670fbb74e3cfc89679572093067fc72396028d3b1637c224676d4c52d86aaafd688143e28499217f0b513c7d5035ba42c4
7
- data.tar.gz: 6a9fc3ec933ece355f9bba48ac1de2980a3c105f0baaf2a13684ab74a54028daec5f2695dee25c4d970d3dc71f7bd066d207977424f8f199c44f8f61e9e6ae85
6
+ metadata.gz: 78c0f02d1ab1b7944a78cecf776f25eb86ccb03861fa7b35cb1a163a4eaaddd1124e19d6ad7e342b46a356770bc65932dc9a695466ba105c4b0a2cc9980ca93a
7
+ data.tar.gz: a2878afecc2b0586f7fc51983a70bad3a531ac0260c0332d5018e429e0c0c5153a46fd35cd01694b616abb798e3534576b515216d08791c736de99cde5a3131a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.4.1] - 2026-07-20
4
+
5
+ - Name the underlying thread of each worker and coordinator `Ractor`
6
+
3
7
  ## [0.4.0] - 2026-05-20
4
8
 
5
9
  - Add `:round_robin` dispatch strategy
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class RactorPool
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
data/lib/ractor-pool.rb CHANGED
@@ -217,7 +217,12 @@ class RactorPool
217
217
  ractor_name = String.new("#{self.class.name} coordinator ractor")
218
218
  ractor_name << " for #{@name}" if @name
219
219
 
220
- Ractor.new(@size, @result_port, name: ractor_name) do |worker_count, result_port|
220
+ thread_name = String.new("#{self.class.name} coordinator thread")
221
+ thread_name << " for #{@name}" if @name
222
+
223
+ Ractor.new(@size, @result_port, thread_name, name: ractor_name) do |worker_count, result_port, thread_name|
224
+ Thread.current.name = thread_name
225
+
221
226
  work_queue = []
222
227
  waiting_workers = []
223
228
  shutdown_received = false
@@ -272,7 +277,12 @@ class RactorPool
272
277
  ractor_name = String.new("#{self.class.name} ractor #{index}")
273
278
  ractor_name << " for #{@name}" if @name
274
279
 
275
- Ractor.new(@worker, @on_error, @error_port, @coordinator, @result_port, name: ractor_name) do |worker, on_error, error_port, coordinator, result_port|
280
+ thread_name = String.new("#{self.class.name} worker thread #{index}")
281
+ thread_name << " for #{@name}" if @name
282
+
283
+ Ractor.new(@worker, @on_error, @error_port, @coordinator, @result_port, thread_name, name: ractor_name) do |worker, on_error, error_port, coordinator, result_port, thread_name|
284
+ Thread.current.name = thread_name
285
+
276
286
  loop do
277
287
  coordinator&.send(Ractor.current, move: true)
278
288
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ractor-pool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Young