Skip to content

Commit

Permalink
THRIFT-136. s/async/oneway/ in Erlang
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dreiss committed Mar 24, 2009
1 parent a8cce87 commit 7490100
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/cpp/src/generate/t_erl_generator.cc
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion lib/erl/src/thrift_client.erl
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions lib/erl/src/thrift_processor.erl
Expand Up @@ -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 ->
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 7490100

Please sign in to comment.