Method: Async::WorkerPool::Worker#call

Defined in:
lib/async/worker_pool.rb

#call(work) ⇒ Object

Call the work and notify the scheduler when it is done.

[View source]

129
130
131
132
133
134
135
136
137
138
139
# File 'lib/async/worker_pool.rb', line 129

def call(work)
	promise = Promise.new(work)
	
	@work.push(promise)
	
	begin
		return promise.wait
	ensure
		promise.cancel
	end
end