Class: Hackle::Executors

Inherits:
Object
  • Object
show all
Defined in:
lib/hackle/internal/concurrent/executors.rb

Class Method Summary collapse

Class Method Details

.schedulerTimerScheduler

Returns:



16
17
18
# File 'lib/hackle/internal/concurrent/executors.rb', line 16

def self.scheduler
  TimerScheduler.new
end

.thread_pool(pool_size:, queue_capacity:) ⇒ Concurrent::ThreadPoolExecutor

Parameters:

  • pool_size (Integer)
  • queue_capacity (Integer)

Returns:

  • (Concurrent::ThreadPoolExecutor)


11
12
13
# File 'lib/hackle/internal/concurrent/executors.rb', line 11

def self.thread_pool(pool_size:, queue_capacity:)
  Concurrent::ThreadPoolExecutor.new(min_threads: pool_size, max_threads: pool_size, max_queue: queue_capacity)
end