るりまサーチ

最速Rubyリファレンスマニュアル検索!
210件ヒット [201-210件を表示] (0.096秒)

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. range end

ライブラリ

モジュール

キーワード

検索結果

<< < 1 2 3 >>

Thread::Queue#close -> self (13.0)

キューを close します。close 済みのキューを再度 open することはできません。

...のように動作します。

* Thread::Queue#closed? は true を返します
* Thread::Queue#close は無視されます
* Thread::Queue#enq/push/<< は ClosedQueueError を発生します
* Thread::Queue#empty? が false を返す場合は Thread::Queue#deq/pop/shift は通常通りオブ...
...ジェクトを返します

また、ClosedQueueError は StopIteration を継承しているため、
close する事でループから脱出する事もできます。

例:

q = Queue.new
Thread.new{
while e = q.deq # wait for nil to break loop
# ...
end

}
q.close...
<< < 1 2 3 >>