Module: Concurrent::UsesGlobalThreadPool

Included in:
Agent, Future, Promise
Defined in:
lib/concurrent/global_thread_pool.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/concurrent/global_thread_pool.rb', line 25

def self.included(base)
  class << base
    def thread_pool
      @thread_pool || $GLOBAL_THREAD_POOL
    end
    def thread_pool=(pool)
      if pool == $GLOBAL_THREAD_POOL
        @thread_pool = nil
      else
        @thread_pool = pool
      end
    end
  end
end