diff options
author | Konrad Grochowski <hcorg@minions.org.pl> | 2014-09-16 19:39:19 +0200 |
---|---|---|
committer | Konrad Grochowski <hcorg@apache.org> | 2014-09-29 22:08:58 +0200 |
commit | 05d64b4e3bcac81b31b89a2db2255edd72b783a8 (patch) | |
tree | 00c3288ee210db45ae7f7d1a6ed4ee662b03178a /lib/rb | |
parent | 1ff4a97a45a78e4afe88660927fb798c18336f7d (diff) | |
download | thrift-05d64b4e3bcac81b31b89a2db2255edd72b783a8.tar.gz |
THRIFT-2707: rb - support for oneway messages fixed
Client: Ruby Library, Ruby Compiler
Patch: Konrad Grochowski
now oneway method calls will use proper message type
This closes #217
Diffstat (limited to 'lib/rb')
-rw-r--r-- | lib/rb/lib/thrift/client.rb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/rb/lib/thrift/client.rb b/lib/rb/lib/thrift/client.rb index 5b30f0150..64ef05956 100644 --- a/lib/rb/lib/thrift/client.rb +++ b/lib/rb/lib/thrift/client.rb @@ -1,4 +1,4 @@ -# +# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information @@ -6,16 +6,16 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -# +# module Thrift module Client @@ -27,6 +27,15 @@ module Thrift def send_message(name, args_class, args = {}) @oprot.write_message_begin(name, MessageTypes::CALL, @seqid) + send_message_args(args_class, args) + end + + def send_oneway_message(name, args_class, args = {}) + @oprot.write_message_begin(name, MessageTypes::ONEWAY, @seqid) + send_message_args(args_class, args) + end + + def send_message_args(args_class, args) data = args_class.new args.each do |k, v| data.send("#{k.to_s}=", v) |