|
@@ -18,6 +18,7 @@
|
|
backend,
|
|
backend,
|
|
handler,
|
|
handler,
|
|
queue = queue:new(),
|
|
queue = queue:new(),
|
|
|
|
+ async,
|
|
ready,
|
|
ready,
|
|
timeout}).
|
|
timeout}).
|
|
|
|
|
|
@@ -56,13 +57,14 @@ handle_call({connect, Host, Username, Password, Opts},
|
|
Database -> Opts3 = [Opts2 | ["database", 0, Database, 0]]
|
|
Database -> Opts3 = [Opts2 | ["database", 0, Database, 0]]
|
|
end,
|
|
end,
|
|
send(State2, [<<196608:?int32>>, Opts3, 0]),
|
|
send(State2, [<<196608:?int32>>, Opts3, 0]),
|
|
- %% TODO Async = proplists:get_value(async, Opts, undefined),
|
|
|
|
|
|
+ Async = proplists:get_value(async, Opts, undefined),
|
|
setopts(State2, [{active, true}]),
|
|
setopts(State2, [{active, true}]),
|
|
put(username, Username),
|
|
put(username, Username),
|
|
put(password, Password),
|
|
put(password, Password),
|
|
{noreply,
|
|
{noreply,
|
|
State2#state{handler = auth,
|
|
State2#state{handler = auth,
|
|
- queue = queue:in(From, Queue)},
|
|
|
|
|
|
+ queue = queue:in(From, Queue),
|
|
|
|
+ async = Async},
|
|
Timeout}.
|
|
Timeout}.
|
|
|
|
|
|
handle_cast(cancel, State = #state{backend = {Pid, Key}}) ->
|
|
handle_cast(cancel, State = #state{backend = {Pid, Key}}) ->
|