From 2047104cda76bc4355676a324c79ee831d6cffd2 Mon Sep 17 00:00:00 2001 From: Gregory Burd Date: Mon, 19 Aug 2013 12:20:36 -0400 Subject: [PATCH] Remove the sleep from async_nif's EAGAIN path because it doesn't seem to have a positive effect. --- src/async_nif.hrl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/async_nif.hrl b/src/async_nif.hrl index b8f7be3..be61b54 100644 --- a/src/async_nif.hrl +++ b/src/async_nif.hrl @@ -22,7 +22,7 @@ %% ------------------------------------------------------------------- -define(ASYNC_NIF_CALL(Fun, Args), - F = fun(F, T) -> + F = fun(F) -> R = erlang:make_ref(), case erlang:apply(F, [R|Args]) of {ok, enqueued} -> @@ -37,11 +37,9 @@ Reply end; {error, eagain} -> - SleepyTime = min(30, (T+1)*2), - timer:sleep(SleepyTime), - F(F, SleepyTime); + F(F); Other -> Other end end, - F(Fun, 0)). + F(Fun)).