Class: Async::Reactor
Overview
A wrapper around the the scheduler which binds it to the current thread automatically.
Instance Attribute Summary
Attributes inherited from Node
#annotation, #children, #head, #parent, #tail
Class Method Summary collapse
-
.run ⇒ Object
deprecated
Deprecated.
Replaced by Kernel::Async.
Instance Method Summary collapse
-
#initialize ⇒ Reactor
constructor
A new instance of Reactor.
- #scheduler_close ⇒ Object
Methods inherited from Scheduler
#address_resolve, #async, #block, #close, #closed?, #fiber, #interrupt, #io_read, #io_wait, #io_write, #kernel_sleep, #load, #process_wait, #push, #raise, #resume, #run, #run_once, supported?, #terminate, #timeout_after, #to_s, #transfer, #unblock, #with_timeout, #yield
Methods inherited from Node
#The parent node.=, #annotate, #backtrace, #children?, #consume, #description, #finished?, #print_hierarchy, #root, #stop, #stopped?, #terminate, #to_s, #transient?, #traverse
Constructor Details
#initialize ⇒ Reactor
Returns a new instance of Reactor.
18 19 20 21 22 |
# File 'lib/async/reactor.rb', line 18 def initialize(...) super Fiber.set_scheduler(self) end |
Class Method Details
.run ⇒ Object
Deprecated.
Replaced by Kernel::Async.
14 15 16 |
# File 'lib/async/reactor.rb', line 14 def self.run(...) Async(...) end |
Instance Method Details
#scheduler_close ⇒ Object
24 25 26 |
# File 'lib/async/reactor.rb', line 24 def scheduler_close self.close end |