Guest User

Untitled

a guest
Apr 24th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. require 'rubygems'
  2. require 'eventmachine'
  3.  
  4. $stdout.sync = true
  5. $stderr.sync = true
  6.  
  7. EM.run {
  8.  
  9. EM.add_periodic_timer(0.1) {
  10. $stdout.write "stdout\n"
  11. }
  12.  
  13. EM.add_periodic_timer(0.1) {
  14. $stderr.write "stderr\n"
  15. }
  16.  
  17. EM.add_timer(1) {
  18. $stdout.write "stopping from stdout...\n"
  19. $stderr.write "stopping from stderr...\n"
  20. EM.stop
  21.  
  22. }
  23.  
  24.  
  25. }
Add Comment
Please, Sign In to add comment