Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'eventmachine'
- $stdout.sync = true
- $stderr.sync = true
- EM.run {
- EM.add_periodic_timer(0.1) {
- $stdout.write "stdout\n"
- }
- EM.add_periodic_timer(0.1) {
- $stderr.write "stderr\n"
- }
- EM.add_timer(1) {
- $stdout.write "stopping from stdout...\n"
- $stderr.write "stopping from stderr...\n"
- EM.stop
- }
- }
Add Comment
Please, Sign In to add comment