MCPcopy Create free account
hub / github.com/apache/arrow / initialize

Method initialize

dev/release/binary-task.rb:39–52  ·  view source on GitHub ↗
(use_case, &worker)

Source from the content-addressed store, hash-verified

37
38 class ThreadPool
39 def initialize(use_case, &worker)
40 @n_workers = choose_n_workers(use_case)
41 @worker = worker
42 @jobs = Thread::Queue.new
43 @workers = @n_workers.times.collect do
44 Thread.new do
45 loop do
46 job = @jobs.pop
47 break if job.nil?
48 @worker.call(job)
49 end
50 end
51 end
52 end
53
54 def <<(job)
55 @jobs << job

Callers

nothing calls this directly

Calls 2

callMethod · 0.80
newMethod · 0.45

Tested by

no test coverage detected