HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/share/ri/3.0.0/system/Ractor/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::BlankLineo: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:#2 test.rb:1 running> (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