Module: Reacto::Executors

Defined in:
lib/reacto/executors.rb

Class Method Summary collapse

Class Method Details

.currentObject



13
14
15
# File 'lib/reacto/executors.rb', line 13

def current
  immediate
end

.immediateObject



9
10
11
# File 'lib/reacto/executors.rb', line 9

def immediate
  @immediate ||= Concurrent::ImmediateExecutor.new
end

.ioObject



17
18
19
# File 'lib/reacto/executors.rb', line 17

def io
  @io ||= Concurrent::CachedThreadPool.new
end

.new_threadObject



25
26
27
# File 'lib/reacto/executors.rb', line 25

def new_thread
  @new_thread ||= Concurrent::SimpleExecutorService.new
end

.tasksObject



21
22
23
# File 'lib/reacto/executors.rb', line 21

def tasks
  @tasks ||= Concurrent::FixedThreadPool.new(4) # Number of cores here?
end