るりまサーチ

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

別のキーワード

  1. _builtin stopiteration
  2. stopiteration result
  3. loop stopiteration
  4. stopiteration _builtin
  5. peek stopiteration

ライブラリ

クラス

検索結果

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

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

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

close
後は以下のように動作します。

* Thread::Queue#closed? は true を返します
* Thread::Queue#close は無視されます
* Thread::Queue#enq/push/<< は ClosedQueueError...
...オブジェクトを返します

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

例:

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

NEWS for Ruby 2.3.0 (24.0)

NEWS for Ruby 2.3.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...サポートの有無を実行時ではなくビルド時に検出するためです。
11806

* Kernel
* Kernel.#loop は StopIteration で停止したときに nil ではなく最後に評価した要素を返します。
11498

* Module
* Module#deprecate_constant...
...s directly).
TracePoint also ignores these calls.
11569

* Queue (Thread::Queue)
* 終了を通知するために Queue#close(Thread::Queue#close) を追加
10600

* Regexp/String: Unicode のバージョンを 7.0.0 から 8.0.0 に更新

* RubyVM::InstructionSequence...
...ーディングであっても例外が発生しなくなりました。
11801

* IO
* クローズ済みのIOオブジェクトに IO#close を呼んでも例外が発生しなくなりました。
10718
* IO#each_codepoint は、変換時、EOFの前に不完全な文字が...