ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ???????????????????????????????????? ???????????????????????????????????? ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. ???????????????????????????????????? ???????????????????????????????????? U:RDoc::AnyMethod[iI" take:ETI"Ractor#take;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"gGet a message from the ractor's outgoing port, which was put there by Ractor.yield or at ractor's ;TI"termination.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [ I"r = Ractor.new do ;TI"% Ractor.yield 'explicit yield' ;TI" 'last value' ;TI" end ;TI"&puts r.take #=> 'explicit yield' ;TI""puts r.take #=> 'last value' ;TI"Mputs r.take # Ractor::ClosedError (The outgoing-port is already closed) ;T: @format0o; ; [I"bThe fact that the last value is also sent to the outgoing port means that +take+ can be used ;TI"`as an analog of Thread#join ("just wait until ractor finishes"). However, it will raise if ;TI"0somebody has already consumed that message.;T@o; ; [I"eIf the outgoing port was closed with #close_outgoing, the method will raise Ractor::ClosedError.;T@o; ; [ I"r = Ractor.new do ;TI" sleep(500) ;TI"( Ractor.yield 'Hello from ractor' ;TI" end ;TI"r.close_outgoing ;TI" r.take ;TI"A# Ractor::ClosedError (The outgoing-port is already closed) ;TI"R# The error would be raised immediately, not when ractor will try to receive ;T; 0o; ; [I"UIf an uncaught exception is raised in the Ractor, it is propagated by take as a ;TI"Ractor::RemoteError.;T@o; ; [I"7r = Ractor.new {raise "Something weird happened"} ;TI" ;TI" begin ;TI" r.take ;TI"rescue => e ;TI"O p e # => # ;TI"" p e.ractor == r # => true ;TI"G p e.cause # => # ;TI" end ;T; 0o; ; [I"gRactor::ClosedError is a descendant of StopIteration, so the termination of the ractor will break ;TI"Nout of any loops that receive this message without propagating the error:;T@o; ; [ I"r = Ractor.new do ;TI"1 3.times {|i| Ractor.yield "message #{i}"} ;TI" "finishing" ;TI" end ;TI" ;TI"'loop {puts "Received: " + r.take} ;TI""puts "Continue successfully" ;T; 0o; ; [I"This will print:;T@o; ; [ I"Received: message 0 ;TI"Received: message 1 ;TI"Received: message 2 ;TI"Received: finishing ;TI"Continue successfully;T; 0: @fileI"ractor.rb;T:0@omit_headings_from_table_of_contents_below0I"ractor.take -> msg ;T0[I"();T@QFI" Ractor;TcRDoc::NormalClass00