diff --git a/src/async_nif.hrl b/src/async_nif.hrl index 2b9d85c..5110fa2 100644 --- a/src/async_nif.hrl +++ b/src/async_nif.hrl @@ -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 - {ok, enqueued} -> - receive - {R, {error, shutdown}=Error} -> - %% Work unit was queued, but not executed. - Error; - {R, {error, _Reason}=Error} -> - %% Work unit returned an error. - Error; - {R, 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)). +-define(ASYNC_NIF_CALL(Fun, Args), + begin + NIFRef = erlang:make_ref(), + case erlang:apply(Fun, [NIFRef|Args]) of + {ok, enqueued} -> + receive + {NIFRef, {error, shutdown}=Error} -> + %% Work unit was queued, but not executed. + Error; + {NIFRef, {error, _Reason}=Error} -> + %% Work unit returned an error. + Error; + {NIFRef, Reply} -> + Reply + end; + Other -> + Other + end + end). diff --git a/tools/wterl-b_b.config b/tools/wterl-b_b.config index 5ce92cc..508a270 100644 --- a/tools/wterl-b_b.config +++ b/tools/wterl-b_b.config @@ -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, []},