Module: Infrastruct

Defined in:
lib/infrastruct.rb,
lib/infrastruct/runner.rb,
lib/infrastruct/manager.rb,
lib/infrastruct/version.rb,
lib/infrastruct/thread_pool.rb,
lib/infrastruct/blocking_queue.rb

Defined Under Namespace

Classes: BlockingQueue, Manager, Runner, ThreadPool

Constant Summary collapse

VERSION =
'0.3.0'

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
13
14
# File 'lib/infrastruct.rb', line 9

def create
  runner = Infrastruct::Runner.new(self)
  pool = Infrastruct::ThreadPool.new(runner, threads: options[:threads])

  Manager.new(pool)
end

#options(options = {}) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/infrastruct.rb', line 16

def options(options = {})
  @options ||= { threads: 25 }

  @options.merge(options)

  @options
end