blob: d82f9405bd640348dbade27e23246e461743e081 [file] [log] [blame]
David Reiss60b50cf2008-06-10 22:59:10 +00001-module(stress_server).
2
David Reiss60b50cf2008-06-10 22:59:10 +00003
David Reiss8cf694d2008-06-11 00:57:54 +00004-export([start_link/1,
David Reiss60b50cf2008-06-10 22:59:10 +00005
6 handle_function/2,
7
8 echoVoid/0,
9 echoByte/1,
10 echoI32/1,
11 echoI64/1,
12 echoString/1,
13 echoList/1,
14 echoSet/1,
15 echoMap/1
16 ]).
17
18start_link(Port) ->
19 thrift_server:start_link(Port, service_thrift, ?MODULE).
20
David Reiss60b50cf2008-06-10 22:59:10 +000021
22handle_function(Function, Args) ->
23 case apply(?MODULE, Function, tuple_to_list(Args)) of
24 ok ->
25 ok;
26 Else -> {reply, Else}
27 end.
28
29
30echoVoid() ->
31 ok.
32echoByte(X) ->
33 X.
34echoI32(X) ->
35 X.
36echoI64(X) ->
37 X.
38echoString(X) ->
39 X.
40echoList(X) ->
41 X.
42echoSet(X) ->
43 X.
44echoMap(X) ->
45 X.