Class: Infrastruct::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/infrastruct/manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(thread_pool) ⇒ Manager

Returns a new instance of Manager.



5
6
7
8
9
# File 'lib/infrastruct/manager.rb', line 5

def initialize(thread_pool)
  @thread_pool = thread_pool

  @thread_pool.run
end

Instance Attribute Details

#queueObject (readonly)

Returns the value of attribute queue.



3
4
5
# File 'lib/infrastruct/manager.rb', line 3

def queue
  @queue
end

Instance Method Details

#enqueue(*args) ⇒ Object



11
12
13
# File 'lib/infrastruct/manager.rb', line 11

def enqueue(*args)
  @thread_pool.enqueue(args)
end

#resultObject



15
16
17
# File 'lib/infrastruct/manager.rb', line 15

def result
  @thread_pool.finalize
end