Class: Async::Reactor
Overview
A wrapper around the the scheduler which binds it to the current thread automatically.
Constant Summary
Constants inherited from Scheduler
Scheduler::DEFAULT_WORKER_POOL
Instance Attribute Summary
Attributes inherited from Node
#A useful identifier for the current node., #Optional list of children., #annotation, #children, #head, #parent, #tail
Class Method Summary collapse
- 
  
    
      .run  ⇒ Object 
    
    
  
  
  
  
  
  
  deprecated
  
  
    Deprecated. Replaced by Kernel::Async. 
Instance Method Summary collapse
- 
  
    
      #initialize  ⇒ Reactor 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    Initialize the reactor and assign it to the current Fiber scheduler. 
- 
  
    
      #scheduler_close  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Close the reactor and remove it from the current Fiber scheduler. 
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, #stop, 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=, #transient?, #traverse
Constructor Details
#initialize ⇒ Reactor
Initialize the reactor and assign it to the current Fiber scheduler.
| 19 20 21 22 23 | # File 'lib/async/reactor.rb', line 19 def initialize(...) super Fiber.set_scheduler(self) end | 
Class Method Details
.run ⇒ Object
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
Close the reactor and remove it from the current Fiber scheduler.
| 26 27 28 | # File 'lib/async/reactor.rb', line 26 def scheduler_close self.close end |