# File lib/protocols/postgres.rb, line 149 149: def query sql 150: d = EM::DefaultDeferrable.new 151: d.timeout 15 152: 153: if @pending_query || @pending_conn 154: d.succeed false, "Operation already in progress" 155: else 156: @r = PostgresPR::Connection::Result.new 157: @e = [] 158: @pending_query = d 159: send_data PostgresPR::Query.dump(sql) 160: end 161: 162: d 163: end