⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
3.0.0
/
system
/
Ractor
/
Edit File: new-c.ri
U:RDoc::AnyMethod[iI"new:ETI"Ractor::new;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"/Create a new Ractor with args and a block.;To:RDoc::Markup::BlankLine o; ; [I"OA block (Proc) will be isolated (can't access to outer variables). +self+ ;TI"7inside the block will refer to the current Ractor.;T@o:RDoc::Markup::Verbatim; [I"8r = Ractor.new { puts "Hi, I am #{self.inspect}" } ;TI"r.take ;TI"8# Prints "Hi, I am #<Ractor:#2 test.rb:1 running>" ;T:@format0o; ; [I"X+args+ passed to the method would be propagated to block args by the same rules as ;TI"Tobjects passed through #send/Ractor.receive: if +args+ are not shareable, they ;TI"Cwill be copied (via deep cloning, which might be inefficient).;T@o;; [I"arg = [1, 2, 3] ;TI"0puts "Passing: #{arg} (##{arg.object_id})" ;TI")r = Ractor.new(arg) {|received_arg| ;TI"E puts "Received: #{received_arg} (##{received_arg.object_id})" ;TI"} ;TI"r.take ;TI"# Prints: ;TI"## Passing: [1, 2, 3] (#280) ;TI"$# Received: [1, 2, 3] (#300) ;T; 0o; ; [I"7Ractor's +name+ can be set for debugging purposes:;T@o;; [I"*r = Ractor.new(name: 'my ractor') {} ;TI" p r ;TI"4#=> #<Ractor:#3 my ractor test.rb:1 terminated>;T; 0: @fileI"ractor.rb;T:0@omit_headings_from_table_of_contents_below0I"=Ractor.new(*args, name: nil) {|*args| block } -> ractor ;T0[ I"(*args, name: nil, &block);T@0FI"Ractor;TcRDoc::NormalClass00
Simpan