mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 02:45:22 +00:00
THRIFT-2708 add support for oneway (async) function calls in erlang client
Client: Erlang Patch: Nobuaki Sukegawa Add timeout to oneway call in cross test client.
This commit is contained in:
parent
7bdba5c06a
commit
7ab56e835c
@ -136,6 +136,15 @@ start(Args) ->
|
||||
ClientS4
|
||||
end,
|
||||
|
||||
%% Use deprecated erlang:now until we start requiring OTP18
|
||||
%% Started = erlang:monotonic_time(milli_seconds),
|
||||
{_, StartSec, StartUSec} = erlang:now(),
|
||||
{Client20, {ok, ok}} = thrift_client:call(Client19, testOneway, [1]),
|
||||
{_, EndSec, EndUSec} = erlang:now(),
|
||||
Elapsed = (EndSec - StartSec) * 1000 + (EndUSec - StartUSec) / 1000,
|
||||
if
|
||||
Elapsed > 1000 -> exit(1);
|
||||
true -> true
|
||||
end,
|
||||
|
||||
thrift_client:close(Client20).
|
||||
|
Loading…
Reference in New Issue
Block a user