| Bryan Duxbury | def30a6 | 2009-04-08 00:19:37 +0000 | [diff] [blame] | 1 | Thrift Erlang Software Library | 
 | 2 |  | 
 | 3 | License | 
 | 4 | ======= | 
 | 5 |  | 
 | 6 | Licensed to the Apache Software Foundation (ASF) under one | 
 | 7 | or more contributor license agreements. See the NOTICE file | 
 | 8 | distributed with this work for additional information | 
 | 9 | regarding copyright ownership. The ASF licenses this file | 
 | 10 | to you under the Apache License, Version 2.0 (the | 
 | 11 | "License"); you may not use this file except in compliance | 
 | 12 | with the License. You may obtain a copy of the License at | 
 | 13 |  | 
 | 14 |   http://www.apache.org/licenses/LICENSE-2.0 | 
 | 15 |  | 
 | 16 | Unless required by applicable law or agreed to in writing, | 
 | 17 | software distributed under the License is distributed on an | 
 | 18 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | 
 | 19 | KIND, either express or implied. See the License for the | 
 | 20 | specific language governing permissions and limitations | 
 | 21 | under the License. | 
 | 22 |  | 
 | 23 | Example | 
 | 24 | ======= | 
 | 25 |  | 
| David Reiss | 702019c | 2008-06-11 00:58:13 +0000 | [diff] [blame] | 26 | Example session using thrift_client: | 
 | 27 |  | 
| David Reiss | f32d0fb | 2010-08-30 22:05:00 +0000 | [diff] [blame] | 28 | 118> f(), {ok, C} = thrift_client:start_link("localhost", 9090, thriftTest_thrif | 
 | 29 | t). | 
 | 30 | {ok,<0.271.0>} | 
 | 31 | 119> thrift_client:call(C, testVoid, []). | 
| David Reiss | 702019c | 2008-06-11 00:58:13 +0000 | [diff] [blame] | 32 | {ok,ok} | 
| David Reiss | f32d0fb | 2010-08-30 22:05:00 +0000 | [diff] [blame] | 33 | 120> thrift_client:call(C, testVoid, [asdf]). | 
| David Reiss | 702019c | 2008-06-11 00:58:13 +0000 | [diff] [blame] | 34 | {error,{bad_args,testVoid,[asdf]}} | 
| David Reiss | f32d0fb | 2010-08-30 22:05:00 +0000 | [diff] [blame] | 35 | 121> thrift_client:call(C, testI32, [123]). | 
| David Reiss | 702019c | 2008-06-11 00:58:13 +0000 | [diff] [blame] | 36 | {ok,123} | 
| David Reiss | f32d0fb | 2010-08-30 22:05:00 +0000 | [diff] [blame] | 37 | 122> thrift_client:call(C, testOneway, [1]). | 
| David Reiss | 702019c | 2008-06-11 00:58:13 +0000 | [diff] [blame] | 38 | {ok,ok} | 
| David Reiss | f32d0fb | 2010-08-30 22:05:00 +0000 | [diff] [blame] | 39 | 123> catch thrift_client:call(C, testXception, ["foo"]). | 
| David Reiss | 702019c | 2008-06-11 00:58:13 +0000 | [diff] [blame] | 40 | {error,{no_function,testXception}} | 
| David Reiss | f32d0fb | 2010-08-30 22:05:00 +0000 | [diff] [blame] | 41 | 124> catch thrift_client:call(C, testException, ["foo"]). | 
| David Reiss | 702019c | 2008-06-11 00:58:13 +0000 | [diff] [blame] | 42 | {ok,ok} | 
| David Reiss | f32d0fb | 2010-08-30 22:05:00 +0000 | [diff] [blame] | 43 | 125> catch thrift_client:call(C, testException, ["Xception"]). | 
 | 44 | {xception,1001,"This is an Xception"} | 
 | 45 | 126> thrift_client:call(C, testException, ["Xception"]). | 
 | 46 |  | 
 | 47 | =ERROR REPORT==== 24-Feb-2008::23:00:23 === | 
 | 48 | Error in process <0.269.0> with exit value: {{nocatch,{xception,1001,"This is an | 
 | 49 |  Xception"}},[{thrift_client,call,3},{erl_eval,do_apply,5},{shell,exprs,6},{shel | 
 | 50 | l,eval_loop,3}]} | 
 | 51 |  | 
 | 52 | ** exited: {{nocatch,{xception,1001,"This is an Xception"}}, | 
 | 53 |             [{thrift_client,call,3}, | 
 | 54 |              {erl_eval,do_apply,5}, | 
 | 55 |              {shell,exprs,6}, | 
 | 56 |              {shell,eval_loop,3}]} ** |