# File lib/eventmachine.rb, line 996
 996:         def self::popen cmd, handler=nil
 997:                 klass = if (handler and handler.is_a?(Class))
 998:                         handler
 999:                 else
1000:                         Class.new( Connection ) {handler and include handler}
1001:                 end
1002: 
1003:                 w = Shellwords::shellwords( cmd )
1004:                 w.unshift( w.first ) if w.first
1005:                 s = invoke_popen( w )
1006:                 c = klass.new s
1007:                 @conns[s] = c
1008:                 yield(c) if block_given?
1009:                 c
1010:         end