Class: Async::Reactor

Inherits:
Scheduler show all
Defined in:
lib/async/reactor.rb

Overview

A wrapper around the the scheduler which binds it to the current thread automatically.

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

Instance Method Summary collapse

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

#initializeReactor

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

.runObject

Deprecated.

Replaced by Kernel::Async.



14
15
16
# File 'lib/async/reactor.rb', line 14

def self.run(...)
	Async(...)
end

Instance Method Details

#scheduler_closeObject

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