# File lib/eventmachine.rb, line 957
957:         def self::popen cmd, handler=nil
958:                 klass = if (handler and handler.is_a?(Class))
959:                         handler
960:                 else
961:                         Class.new( Connection ) {handler and include handler}
962:                 end
963: 
964:                 w = Shellwords::shellwords( cmd )
965:                 w.unshift( w.first ) if w.first
966:                 s = invoke_popen( w )
967:                 c = klass.new s
968:                 @conns[s] = c
969:                 yield(c) if block_given?
970:                 c
971:         end