Method: Async::Condition#signal

Defined in:
lib/async/condition.rb

#signal(value = nil) ⇒ Object

Signal to a given task that it should resume operations.


55
56
57
58
59
60
61
62
63
64
65
# File 'lib/async/condition.rb', line 55

def signal(value = nil)
	return if @waiting.empty?
	
	waiting = self.exchange
	
	waiting.each do |fiber|
		Fiber.scheduler.resume(fiber, value) if fiber.alive?
	end
	
	return nil
end