Skip to content

Instantly share code, notes, and snippets.

@Poincare
Created June 26, 2012 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Poincare/2998314 to your computer and use it in GitHub Desktop.
Save Poincare/2998314 to your computer and use it in GitHub Desktop.
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
@gathuku
Copy link

gathuku commented Oct 14, 2020

Hi @Poincare. Is it possible to set an external trigger for spawned_process.notify. I mean an external trigger outside the EM.run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment