Created
June 26, 2012 19:37
-
-
Save Poincare/2998314 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'eventmachine' | |
EM.run do | |
spawned_process = EM.spawn do |did_what| | |
puts "I just " + did_what | |
end | |
EM.add_periodic_timer(1) do | |
spawned_process.notify "ate" | |
end | |
EM.add_periodic_timer(2) do | |
spawned_process.notify "slept" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @Poincare. Is it possible to set an external trigger for
spawned_process.notify
. I mean an external trigger outside theEM.run