THRIFT-5635 Update erlang client for Erlang 23-25
Client: erl
Patch: Sergey Yelin
This closes #2677
Summary of changes:
- Add useful compiler options
- Format sources using erlfmt
- Switch to modern callbacks in thrift_* modules
- Add static analysis (dialyzer), disabled by default
- Add/fix types for API calls
NOTE: Enabling static analysis requires additional tweaks in multiplexer module.
diff --git a/lib/erl/test/stress_server.erl b/lib/erl/test/stress_server.erl
index 35fff06..78ddefe 100644
--- a/lib/erl/test/stress_server.erl
+++ b/lib/erl/test/stress_server.erl
@@ -19,33 +19,32 @@
-module(stress_server).
+-export([
+ start_link/1,
--export([start_link/1,
+ handle_function/2,
- handle_function/2,
-
- echoVoid/0,
- echoByte/1,
- echoI32/1,
- echoI64/1,
- echoString/1,
- echoList/1,
- echoSet/1,
- echoMap/1
- ]).
+ echoVoid/0,
+ echoByte/1,
+ echoI32/1,
+ echoI64/1,
+ echoString/1,
+ echoList/1,
+ echoSet/1,
+ echoMap/1
+]).
start_link(Port) ->
thrift_server:start_link(Port, service_thrift, ?MODULE).
-
handle_function(Function, Args) ->
case apply(?MODULE, Function, tuple_to_list(Args)) of
ok ->
- ok;
- Else -> {reply, Else}
+ ok;
+ Else ->
+ {reply, Else}
end.
-
echoVoid() ->
ok.
echoByte(X) ->