diff options
author | David Reiss <dreiss@apache.org> | 2010-08-30 22:06:03 +0000 |
---|---|---|
committer | David Reiss <dreiss@apache.org> | 2010-08-30 22:06:03 +0000 |
commit | f4494ee3a9a4751e6537527bb7a46d2daba20bed (patch) | |
tree | 68a49cc4f7d886903fabc8372beca9dfb2659e11 /lib/erl/src | |
parent | c549f7b08622dd96060f9596bae3547d00b7db7c (diff) | |
download | thrift-f4494ee3a9a4751e6537527bb7a46d2daba20bed.tar.gz |
erlang: Un-revert r988722
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991003 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'lib/erl/src')
-rw-r--r-- | lib/erl/src/thrift_client.erl | 6 | ||||
-rw-r--r-- | lib/erl/src/thrift_protocol.erl | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/erl/src/thrift_client.erl b/lib/erl/src/thrift_client.erl index f7701b908..5c74adc75 100644 --- a/lib/erl/src/thrift_client.erl +++ b/lib/erl/src/thrift_client.erl @@ -34,7 +34,7 @@ new(Protocol, Service) service = Service, seqid = 0}}. --spec call(#tclient{}, atom(), list()) -> {#tclient{}, {ok, term()} | {error, term()}}. +-spec call(#tclient{}, atom(), list()) -> {#tclient{}, {ok, any()} | {error, any()}}. call(Client = #tclient{}, Function, Args) when is_atom(Function), is_list(Args) -> case send_function_call(Client, Function, Args) of @@ -61,7 +61,7 @@ close(#tclient{protocol=Protocol}) -> %%-------------------------------------------------------------------- %%% Internal functions %%-------------------------------------------------------------------- --spec send_function_call(#tclient{}, atom(), list()) -> {#tclient{}, ok | {error, term()}}. +-spec send_function_call(#tclient{}, atom(), list()) -> {#tclient{}, ok | {error, any()}}. send_function_call(Client = #tclient{protocol = Proto0, service = Service, seqid = SeqId}, @@ -84,7 +84,7 @@ send_function_call(Client = #tclient{protocol = Proto0, {Client#tclient{protocol = Proto4}, ok} end. --spec receive_function_result(#tclient{}, atom()) -> {#tclient{}, {ok, term()} | {error, term()}}. +-spec receive_function_result(#tclient{}, atom()) -> {#tclient{}, {ok, any()} | {error, any()}}. receive_function_result(Client = #tclient{service = Service}, Function) -> ResultType = Service:function_info(Function, reply_type), read_result(Client, Function, ResultType). diff --git a/lib/erl/src/thrift_protocol.erl b/lib/erl/src/thrift_protocol.erl index bb499ce7b..4c334128c 100644 --- a/lib/erl/src/thrift_protocol.erl +++ b/lib/erl/src/thrift_protocol.erl @@ -120,10 +120,10 @@ read(IProto0, {struct, Structure}, Tag) %% NOTE: Keep this in sync with thrift_protocol_behaviour:read -spec read (#protocol{}, {struct, _Info}) -> {#protocol{}, {ok, tuple()} | {error, _Reason}}; - (#protocol{}, tprot_cont_tag()) -> {#protocol{}, {ok, term()} | {error, _Reason}}; + (#protocol{}, tprot_cont_tag()) -> {#protocol{}, {ok, any()} | {error, _Reason}}; (#protocol{}, tprot_empty_tag()) -> {#protocol{}, ok | {error, _Reason}}; (#protocol{}, tprot_header_tag()) -> {#protocol{}, tprot_header_val() | {error, _Reason}}; - (#protocol{}, tprot_data_tag()) -> {#protocol{}, {ok, term()} | {error, _Reason}}. + (#protocol{}, tprot_data_tag()) -> {#protocol{}, {ok, any()} | {error, _Reason}}. read(IProto, {struct, {Module, StructureName}}) when is_atom(Module), is_atom(StructureName) -> @@ -180,7 +180,7 @@ read(Protocol, ProtocolType) -> -spec read_specific (#protocol{}, tprot_empty_tag()) -> {#protocol{}, ok | {error, _Reason}}; (#protocol{}, tprot_header_tag()) -> {#protocol{}, tprot_header_val() | {error, _Reason}}; - (#protocol{}, tprot_data_tag()) -> {#protocol{}, {ok, term()} | {error, _Reason}}. + (#protocol{}, tprot_data_tag()) -> {#protocol{}, {ok, any()} | {error, _Reason}}. read_specific(Proto = #protocol{module = Module, data = ModuleData}, ProtocolType) -> {NewData, Result} = Module:read(ModuleData, ProtocolType), @@ -219,7 +219,7 @@ skip_field(FType, IProto0, SDict, RTuple) -> {IProto2, ok} = read(IProto1, field_end), read_struct_loop(IProto2, SDict, RTuple). --spec skip(#protocol{}, term()) -> {#protocol{}, ok}. +-spec skip(#protocol{}, any()) -> {#protocol{}, ok}. skip(Proto0, struct) -> {Proto1, ok} = read(Proto0, struct_begin), @@ -308,11 +308,11 @@ skip_list_loop(Proto0, Map = #protocol_list_begin{etype = Etype, %% | list() -- for list %% | dictionary() -- for map %% | set() -- for set -%% | term() -- for base types +%% | any() -- for base types %% %% Description: %%-------------------------------------------------------------------- --spec write(#protocol{}, term()) -> {#protocol{}, ok | {error, _Reason}}. +-spec write(#protocol{}, any()) -> {#protocol{}, ok | {error, _Reason}}. write(Proto0, {{struct, StructDef}, Data}) when is_list(StructDef), is_tuple(Data), length(StructDef) == size(Data) - 1 -> |