Skip to content

Commit

Permalink
The basho bench driver now starts a single instance of eredis, which …
Browse files Browse the repository at this point in the history
…all workers are talking to.
  • Loading branch information
Knut Nesheim committed Jun 8, 2011
1 parent 59b94ca commit cb68ee9
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/basho_bench_driver_eredis.erl
Expand Up @@ -6,11 +6,17 @@
-export([value_gen/1]).

new(_Id) ->
case eredis:start_link() of
{ok, Client} ->
{ok, Client};
{error, Reason} ->
{error, Reason}
case whereis(eredis_driver) of
undefined ->
case eredis:start_link() of
{ok, Client} ->
register(eredis_driver, Client),
{ok, Client};
{error, Reason} ->
{error, Reason}
end;
Pid ->
{ok, Pid}
end.

run(get, KeyGen, _ValueGen, Client) ->
Expand Down

0 comments on commit cb68ee9

Please sign in to comment.