tmm1 (owner)

Revisions

  • f2ce18 tmm1 Sat May 02 04:24:42 -0700 2009
  • 8dab9b tmm1 Sat May 02 04:18:11 -0700 2009
  • b77866 tmm1 Sat May 02 03:50:18 -0700 2009
gist: 105506 Download_button fork
public
Description:
EM-enabled stdout (buffered + non-blocking)
Public Clone URL: git://gist.github.com/105506.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
[ $stdout, $stderr ].each do |out|
  def out.write data
    if defined?(EM) && EM.reactor_running?
      (@_em_out ||= EM.attach(fileno)).send_data(data)
    else
      super
    end
  end
end