ÿØÿà 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" send:ETI"Ractor#send;TF: publico:RDoc::Markup::Document: @parts[o:RDoc::Markup::Paragraph; [I"RSend a message to a Ractor's incoming queue to be accepted by Ractor.receive.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim; [ I"r = Ractor.new do ;TI" value = Ractor.receive ;TI" puts "Received #{value}" ;TI" end ;TI"r.send 'message' ;TI"## Prints: "Received: message" ;T: @format0o; ; [I"YThe method is non-blocking (will return immediately even if the ractor is not ready ;TI"to receive anything):;T@o; ; [ I"r = Ractor.new {sleep(5)} ;TI"r.send('test') ;TI"puts "Sent successfully" ;TI"/# Prints: "Sent successfully" immediately ;T; 0o; ; [I"hAn attempt to send to a ractor which already finished its execution will raise Ractor::ClosedError.;T@o; ; [ I"r = Ractor.new {} ;TI" r.take ;TI" p r ;TI"*# "#" ;TI"r.send('test') ;TI"A# Ractor::ClosedError (The incoming-port is already closed) ;T; 0o; ; [I"\If close_incoming was called on the ractor, the method also raises Ractor::ClosedError.;T@o; ; [ I"r = Ractor.new do ;TI" sleep(500) ;TI" receive ;TI" end ;TI"r.close_incoming ;TI"r.send('test') ;TI"A# Ractor::ClosedError (The incoming-port is already closed) ;TI"M# The error is raised immediately, not when the ractor tries to receive ;T; 0o; ; [I"jIf the +obj+ is unshareable, by default it will be copied into the receiving ractor by deep cloning. ;TI"cIf move: true is passed, the object is _moved_ into the receiving ractor and becomes ;TI" inaccessible to the sender.;T@o; ; [ I"2r = Ractor.new {puts "Received: #{receive}"} ;TI"msg = 'message' ;TI"r.send(msg, move: true) ;TI" r.take ;TI" p msg ;T; 0o; ; [I"This prints:;T@o; ; [I"Received: message ;TI"Vin `p': undefined method `inspect' for # ;T; 0o; ; [I"RAll references to the object and its parts will become invalid to the sender.;T@o; ; [I"2r = Ractor.new {puts "Received: #{receive}"} ;TI"s = 'message' ;TI"ary = [s] ;TI"copy = ary.dup ;TI"r.send(ary, move: true) ;TI" ;TI"s.inspect ;TI"G# Ractor::MovedError (can not send any methods to a moved object) ;TI"ary.class ;TI"G# Ractor::MovedError (can not send any methods to a moved object) ;TI"copy.class ;TI"(# => Array, it is different object ;TI"copy[0].inspect ;TI"G# Ractor::MovedError (can not send any methods to a moved object) ;TI"E# ...but its item was still a reference to `s`, which was moved ;T; 0o; ; [I"IIf the object is shareable, move: true has no effect on it:;T@o; ; [ I"2r = Ractor.new {puts "Received: #{receive}"} ;TI"s = 'message'.freeze ;TI"r.send(s, move: true) ;TI"-s.inspect #=> "message", still available;T; 0: @fileI"ractor.rb;T:0@omit_headings_from_table_of_contents_below0I"+ractor.send(msg, move: false) -> self ;T0[[I"<<;To;; [;@i;0I"(obj, move: false);T@iFI" Ractor;TcRDoc::NormalClass00