Linux heracles.o2switch.net 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
/
opt
/
alt
/
ruby27
/
share
/
ri
/
system
/
Queue
/
//opt/alt/ruby27/share/ri/system/Queue/close-i.ri
U:RDoc::AnyMethod[iI" close:ETI"Queue#close;TF:privateo:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [I":Closes the queue. A closed queue cannot be re-opened.;To:RDoc::Markup::BlankLine o; ; [I"?After the call to close completes, the following are true:;T@o:RDoc::Markup::List: @type:BULLET:@items[ o:RDoc::Markup::ListItem:@label0; [o; ; [I"+closed?+ will return true;T@o;;0; [o; ; [I"+close+ will be ignored.;T@o;;0; [o; ; [I"9calling enq/push/<< will raise a +ClosedQueueError+.;T@o;;0; [o; ; [I"Iwhen +empty?+ is false, calling deq/pop/shift will return an object ;TI"from the queue as usual.;To;;0; [o; ; [I"Xwhen +empty?+ is true, deq(false) will not suspend the thread and will return nil. ;TI"*deq(true) will raise a +ThreadError+.;T@o; ; [I"XClosedQueueError is inherited from StopIteration, so that you can break loop block.;T@o:RDoc::Markup::Verbatim; [I"Example: ;TI" ;TI" q = Queue.new ;TI" Thread.new{ ;TI"8 while e = q.deq # wait for nil to break loop ;TI" # ... ;TI" end ;TI" } ;TI" q.close;T:@format0: @fileI"thread_sync.c;T:0@omit_headings_from_table_of_contents_below0I"close ;T0[ I"();T@=FI" Queue;TcRDoc::NormalClass00