Class: Concur::MultiThreaded
Overview
Spins off a new thread per job
Instance Method Summary
collapse
#initialize, #queue_size
Instance Method Details
#execute(f = nil, channel = nil, &blk) ⇒ Object
95
96
97
|
# File 'lib/executor.rb', line 95
def execute(f=nil, channel=nil, &blk)
process(f, channel, &blk)
end
|
#process(f = nil, channel = nil, &blk) ⇒ Object
86
87
88
89
90
91
92
93
|
# File 'lib/executor.rb', line 86
def process(f=nil, channel=nil, &blk)
f = StandardFuture.new(f, channel, &blk)
@thread = Thread.new do
f.call
end
f.thread = @thread
f
end
|
#shutdown ⇒ Object
99
100
101
|
# File 'lib/executor.rb', line 99
def shutdown
end
|