THRIFT-136. s/async/oneway/ in Erlang
authorDavid Reiss <dreiss@apache.org>
Tue, 24 Mar 2009 20:02:08 +0000 (20:02 +0000)
committerDavid Reiss <dreiss@apache.org>
Tue, 24 Mar 2009 20:02:08 +0000 (20:02 +0000)
This is kind of a bummer because it requires a simultaneous
code regeneration and library upgrade, and possibly also a
server restart.  I'm not sure if it is worth it, since the
only benefit is a little code clarity.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@757993 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_erl_generator.cc
lib/erl/src/thrift_client.erl
lib/erl/src/thrift_processor.erl

index 90e95be..e7648ba 100644 (file)
@@ -676,7 +676,7 @@ void t_erl_generator::generate_function_info(t_service* tservice,
     indent(f_service_) <<
         generate_type_term(tfunction->get_returntype(), false) << ";" << endl;
   else if (tfunction->is_oneway())
-    indent(f_service_) << "async_void;" << endl;
+    indent(f_service_) << "oneway_void;" << endl;
   else
     indent(f_service_) << "{struct, []}" << ";" << endl;
   indent_down();
index 40eb5dd..4ed21c9 100644 (file)
@@ -265,7 +265,7 @@ receive_function_result(State = #state{protocol = Proto,
 
 read_result(_State,
             _Function,
-            async_void) ->
+            oneway_void) ->
     {ok, ok};
 
 read_result(State = #state{protocol = Proto,
index 3344666..6340950 100644 (file)
@@ -62,7 +62,7 @@ handle_function(State=#thrift_processor{in_protocol = IProto,
 
 handle_function_catch(State = #thrift_processor{service = Service},
                       Function, ErrType, ErrData) ->
-    IsOneway = Service:function_info(Function, reply_type) =:= async_void,
+    IsOneway = Service:function_info(Function, reply_type) =:= oneway_void,
 
     case {ErrType, ErrData} of
         _ when IsOneway ->
@@ -96,7 +96,7 @@ handle_success(State = #thrift_processor{out_protocol = OProto,
              ok when ReplyType == {struct, []} ->
                  send_reply(OProto, Function, ?tMessageType_REPLY, {ReplyType, {StructName}});
 
-             ok when ReplyType == async_void ->
+             ok when ReplyType == oneway_void ->
                  %% no reply for oneway void
                  ok
          end.