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/Fiber/schedule-c.ri
U:RDoc::AnyMethod[iI"
schedule:ETI"Fiber::schedule;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph;	[I"XThe method is <em>expected</em> to immediately run the provided block of code in a ;TI"!separate non-blocking fiber.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim;	[I"puts "Go to sleep!"
;TI"
;TI"*Fiber.set_scheduler(MyScheduler.new)
;TI"
;TI"Fiber.schedule do
;TI"  puts "Going to sleep"
;TI"  sleep(1)
;TI"  puts "I slept well"
;TI"	end
;TI"
;TI"$puts "Wakey-wakey, sleepyhead"
;T:@format0o;
;	[I"MAssuming MyScheduler is properly implemented, this program will produce:;T@o;;	[
I"Go to sleep!
;TI"Going to sleep
;TI"Wakey-wakey, sleepyhead
;TI"...1 sec pause here...
;TI"I slept well
;T;
0o;
;	[	I"S...e.g. on the first blocking operation inside the Fiber (<tt>sleep(1)</tt>), ;TI"Qthe control is yielded at the outside code (main fiber), and <em>at the end ;TI"Rof the execution</em>, the scheduler takes care of properly resuming all the ;TI"blocked fibers.;T@o;
;	[	I"SNote that the behavior described above is how the method is <em>expected</em> ;TI"Sto behave, actual behavior is up to the current scheduler's implementation of ;TI"QFiber::SchedulerInterface#fiber method. Ruby doesn't enforce this method to ;TI""behave in any particular way.;T@o;
;	[I"4If the scheduler is not set, the method raises ;TI"8<tt>RuntimeError (No scheduler is available!)</tt>.;T:
@fileI"cont.c;T:0@omit_headings_from_table_of_contents_below0I"-Fiber.schedule { |*args| ... } -> fiber
;T0[I"(*args);T@7FI"
Fiber;TcRDoc::NormalClass00