Erlang API improvement: allow to use atoms and tuples to point at the thrift
client
-----------------------------------------------------------------------------------
Key: THRIFT-825
URL: https://issues.apache.org/jira/browse/THRIFT-825
Project: Thrift
Issue Type: Improvement
Components: Compiler (Erlang)
Environment: Any environment
Reporter: Dmitry Demeshchuk
Attachments: thrift_client.erl.diff
Here's the code from thrift_client.erl:
call(Client, Function, Args)
when is_pid(Client), is_atom(Function), is_list(Args) ->
case gen_server:call(Client, {call, Function, Args}) of
R = {ok, _} -> R;
R = {error, _} -> R;
{exception, Exception} -> throw(Exception)
end.
But one may want to use the Client variable as an atom (using
erlang:register()) or as a tuple {Node, Pid}.
So, it's better to remove the is_pid() check. If the Client variable is invalid
- OTP will just raise the "noproc" exception.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.