README.md
1# Thrift Erlang Software Library #
2
3## License ##
4
5Licensed to the Apache Software Foundation (ASF) under one
6or more contributor license agreements. See the NOTICE file
7distributed with this work for additional information
8regarding copyright ownership. The ASF licenses this file
9to you under the Apache License, Version 2.0 (the
10"License"); you may not use this file except in compliance
11with the License. You may obtain a copy of the License at
12
13 http://www.apache.org/licenses/LICENSE-2.0
14
15Unless required by applicable law or agreed to in writing,
16software distributed under the License is distributed on an
17"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18KIND, either express or implied. See the License for the
19specific language governing permissions and limitations
20under the License.
21
22## Release Notes ##
23
24### 0.9.2 ###
25
26as of 0.9.2 struct and function naming conventions have changed. to retain the
27old naming conventions (for backwards compatibility) use the compiler option
28`legacynames`
29
30## Example ##
31
32Example session using thrift_client:
33
34```erl
351> {ok, C0} = thrift_client_util:new("localhost", 9090, thrift_test_thrift, []), ok.
36ok
372> {C1, R1} = thrift_client:call(C0, testVoid, []), R1.
38{ok,ok}
393> {C2, R2} = thrift_client:call(C1, testVoid, [asdf]), R2.
40{error,{bad_args,testVoid,[asdf]}}
414> {C3, R3} = thrift_client:call(C2, testI32, [123]), R3.
42{ok,123}
435> {C4, R4} = thrift_client:call(C3, testOneway, [1]), R4.
44{ok,ok}
456> {C5, R5} = thrift_client:call(C4, testXception, ["foo"]), R5.
46{error,{no_function,testXception}}
477> {C6, R6} = thrift_client:call(C5, testException, ["foo"]), R6.
48{ok,ok}
498> {C7, R7} = (catch thrift_client:call(C6, testException, ["Xception"])), R7.
50{exception,{xception,1001,<<"Xception">>}}
51```
52