num_waiting -> Integer
キューを待っているスレッドの数を返します。
例 require 'thread' q = SizedQueue.new(1) q.push(1) t = Thread.new { q.push(2) } sleep 0.05 until t.stop? q.num_waiting # => 1 q.pop t.join
require 'thread' q = SizedQueue.new(1) q.push(1) t = Thread.new { q.push(2) } sleep 0.05 until t.stop? q.num_waiting # => 1 q.pop t.join