Revert to a macro-only, non-recursive on eagain method for managing requests.
This commit is contained in:
parent
27dba903ef
commit
56c2ac27c2
2 changed files with 25 additions and 27 deletions
|
@ -21,28 +21,22 @@
|
|||
%%
|
||||
%% -------------------------------------------------------------------
|
||||
|
||||
-spec async_nif_enqueue(reference(), function(), [term()]) -> term() | {error, term()}.
|
||||
async_nif_enqueue(R, F, A) ->
|
||||
R = erlang:make_ref(),
|
||||
case erlang:apply(F, [R|A]) of
|
||||
-define(ASYNC_NIF_CALL(Fun, Args),
|
||||
begin
|
||||
NIFRef = erlang:make_ref(),
|
||||
case erlang:apply(Fun, [NIFRef|Args]) of
|
||||
{ok, enqueued} ->
|
||||
receive
|
||||
{R, {error, shutdown}=Error} ->
|
||||
{NIFRef, {error, shutdown}=Error} ->
|
||||
%% Work unit was queued, but not executed.
|
||||
Error;
|
||||
{R, {error, _Reason}=Error} ->
|
||||
{NIFRef, {error, _Reason}=Error} ->
|
||||
%% Work unit returned an error.
|
||||
Error;
|
||||
{R, Reply} ->
|
||||
{NIFRef, Reply} ->
|
||||
Reply
|
||||
end;
|
||||
{error, eagain} ->
|
||||
%% Work unit was not queued, try again.
|
||||
async_nif_enqueue(R, F, A);
|
||||
%{error, enomem} ->
|
||||
%{error, shutdown} ->
|
||||
Other ->
|
||||
Other
|
||||
end.
|
||||
|
||||
-define(ASYNC_NIF_CALL(Fun, Args), async_nif_enqueue(Fun, Args)).
|
||||
end
|
||||
end).
|
||||
|
|
|
@ -26,6 +26,12 @@
|
|||
{mode, max}.
|
||||
{duration, 10}.
|
||||
{concurrent, 4}.
|
||||
{report_interval, 1}.
|
||||
{pb_timeout_general, 1000}. % ms
|
||||
%{pb_timeout_read, ?}.
|
||||
%{pb_timeout_write, ?}.
|
||||
%{pb_timeout_listkeys, ?}.
|
||||
%{pb_timeout_mapreduce, ?}.
|
||||
{driver, basho_bench_driver_wterl}.
|
||||
{key_generator, {int_to_bin_littleendian,{uniform_int, 5000000}}}.
|
||||
{value_generator, {fixed_bin, 10000}}.
|
||||
|
@ -71,8 +77,6 @@
|
|||
{connection, [
|
||||
{create, true},
|
||||
{sync, false},
|
||||
{logging, true},
|
||||
{transactional, true},
|
||||
{session_max, 1024},
|
||||
{cache_size, 4294967296},
|
||||
{verbose, []},
|
||||
|
|
Loading…
Reference in a new issue