Remove the sleep from async_nif's EAGAIN path because it doesn't seem to have a positive effect.
This commit is contained in:
parent
96d43d5d17
commit
2047104cda
1 changed files with 3 additions and 5 deletions
|
@ -22,7 +22,7 @@
|
||||||
%% -------------------------------------------------------------------
|
%% -------------------------------------------------------------------
|
||||||
|
|
||||||
-define(ASYNC_NIF_CALL(Fun, Args),
|
-define(ASYNC_NIF_CALL(Fun, Args),
|
||||||
F = fun(F, T) ->
|
F = fun(F) ->
|
||||||
R = erlang:make_ref(),
|
R = erlang:make_ref(),
|
||||||
case erlang:apply(F, [R|Args]) of
|
case erlang:apply(F, [R|Args]) of
|
||||||
{ok, enqueued} ->
|
{ok, enqueued} ->
|
||||||
|
@ -37,11 +37,9 @@
|
||||||
Reply
|
Reply
|
||||||
end;
|
end;
|
||||||
{error, eagain} ->
|
{error, eagain} ->
|
||||||
SleepyTime = min(30, (T+1)*2),
|
F(F);
|
||||||
timer:sleep(SleepyTime),
|
|
||||||
F(F, SleepyTime);
|
|
||||||
Other ->
|
Other ->
|
||||||
Other
|
Other
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
F(Fun, 0)).
|
F(Fun)).
|
||||||
|
|
Loading…
Reference in a new issue