ÿØÿà 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" select:ETI"Ractor::select;TT: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"\Wait for any ractor to have something in its outgoing port, read from this ractor, and ;TI"5then return that ractor and the object received.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [ I"-r1 = Ractor.new {Ractor.yield 'from 1'} ;TI"-r2 = Ractor.new {Ractor.yield 'from 2'} ;TI" ;TI"$r, obj = Ractor.select(r1, r2) ;TI" ;TI"6puts "received #{obj.inspect} from #{r.inspect}" ;TI"E# Prints: received "from 1" from # ;TI"R# But could just as well print "from r2" here, either prints could be first. ;T: @format0o; ; [I"]If one of the given ractors is the current ractor, and it is selected, +r+ will contain ;TI"8the +:receive+ symbol instead of the ractor object.;T@o; ; [I"/r1 = Ractor.new(Ractor.current) do |main| ;TI" main.send 'to main' ;TI" Ractor.yield 'from 1' ;TI" end ;TI"r2 = Ractor.new do ;TI" Ractor.yield 'from 2' ;TI" end ;TI" ;TI"4r, obj = Ractor.select(r1, r2, Ractor.current) ;TI"6puts "received #{obj.inspect} from #{r.inspect}" ;TI"5# Could print: received "to main" from :receive ;T; 0o; ; [I"aIf +yield_value+ is provided, that value may be yielded if another ractor is calling #take. ;TI"?In this case, the pair [:yield, nil] is returned:;T@o; ; [ I"/r1 = Ractor.new(Ractor.current) do |main| ;TI"/ puts "Received from main: #{main.take}" ;TI" end ;TI" ;TI"puts "Trying to select" ;TI"Br, obj = Ractor.select(r1, Ractor.current, yield_value: 123) ;TI" wait ;TI"6puts "Received #{obj.inspect} from #{r.inspect}" ;T; 0o; ; [I"This will print:;T@o; ; [I"Trying to select ;TI"Received from main: 123 ;TI"Received nil from :yield ;T; 0o; ; [I"Y+move+ boolean flag defines whether yielded value will be copied (default) or moved.;T: @fileI"ractor.rb;T:0@omit_headings_from_table_of_contents_below0I"URactor.select(*ractors, [yield_value:, move: false]) -> [ractor or symbol, obj] ;T0[I"C(*ractors, yield_value: yield_unspecified = true, move: false);T@DFI" Ractor;TcRDoc::NormalClass00