# File lib/thrift/client.rb, line 53 def handle_exception(mtype) if mtype == MessageTypes::EXCEPTION x = ApplicationException.new x.read(@iprot) @iprot.read_message_end raise x end end
# File lib/thrift/client.rb, line 44 def receive_message(result_klass) fname, mtype, rseqid = @iprot.read_message_begin handle_exception(mtype) result = result_klass.new result.read(@iprot) @iprot.read_message_end result end
# File lib/thrift/client.rb, line 28 def send_message(name, args_class, args = {}) @oprot.write_message_begin(name, MessageTypes::CALL, @seqid) data = args_class.new args.each do |k, v| data.send("#{k.to_s}=", v) end begin data.write(@oprot) rescue StandardError => e @oprot.trans.close raise e end @oprot.write_message_end @oprot.trans.flush end
Generated with the Darkfish Rdoc Generator 2.