blob: 7147381edff74062924c51cd2feef98eb1956427 [file] [log] [blame]
David Reiss702019c2008-06-11 00:58:13 +00001Example session using thrift_client:
2
3118> f(), {ok, C} = thrift_client:start_link("localhost", 9090, thriftTest_thrif
4t).
5{ok,<0.271.0>}
David Reiss1a2f2182008-06-11 01:14:01 +00006119> thrift_client:call(C, testVoid, []).
David Reiss702019c2008-06-11 00:58:13 +00007{ok,ok}
8120> thrift_client:call(C, testVoid, [asdf]).
9{error,{bad_args,testVoid,[asdf]}}
David Reiss1a2f2182008-06-11 01:14:01 +000010121> thrift_client:call(C, testI32, [123]).
David Reiss702019c2008-06-11 00:58:13 +000011{ok,123}
12122> thrift_client:call(C, testAsync, [1]).
13{ok,ok}
14123> catch thrift_client:call(C, testXception, ["foo"]).
15{error,{no_function,testXception}}
16124> catch thrift_client:call(C, testException, ["foo"]).
17{ok,ok}
18125> catch thrift_client:call(C, testException, ["Xception"]).
19{xception,1001,"This is an Xception"}
David Reiss1a2f2182008-06-11 01:14:01 +000020126> thrift_client:call(C, testException, ["Xception"]).
David Reiss702019c2008-06-11 00:58:13 +000021
22=ERROR REPORT==== 24-Feb-2008::23:00:23 ===
23Error in process <0.269.0> with exit value: {{nocatch,{xception,1001,"This is an
24 Xception"}},[{thrift_client,call,3},{erl_eval,do_apply,5},{shell,exprs,6},{shel
25l,eval_loop,3}]}
26
27** exited: {{nocatch,{xception,1001,"This is an Xception"}},
28 [{thrift_client,call,3},
29 {erl_eval,do_apply,5},
30 {shell,exprs,6},
31 {shell,eval_loop,3}]} **