Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

better disconnect procedure, thanks zabrane

  • Loading branch information...
commit 1fc2c4f4db78a512cc69939b92f2493a00c23058 1 parent ab4bccc
joewilliams authored
Showing with 5 additions and 5 deletions.
  1. +1 −0  NOTICES
  2. +4 −5 src/merle.erl
View
1  NOTICES
@@ -6,3 +6,4 @@ Contributors and Copyright holders:
* Copyright 2009, Joe Williams <joe@joetify.com>
* Copyright 2009, Nick Gerakines <nick@gerakines.net>
+ * Copyright 2010, Zabrane Mikael <zabrane3@gmail.com>
View
9 src/merle.erl
@@ -238,8 +238,7 @@ connect(Host, Port) ->
%% @doc disconnect from memcached
disconnect() ->
- gen_server2:call(?SERVER, {stop}),
- ok.
+ gen_server2:call(?SERVER, stop).
%% @private
start_link(Host, Port) ->
@@ -249,9 +248,6 @@ start_link(Host, Port) ->
init([Host, Port]) ->
gen_tcp:connect(Host, Port, ?TCP_OPTS).
-handle_call({stop}, _From, Socket) ->
- {stop, requested_disconnect, Socket};
-
handle_call({stats}, _From, Socket) ->
Reply = send_generic_cmd(Socket, iolist_to_binary([<<"stats">>])),
{reply, Reply, Socket};
@@ -342,6 +338,9 @@ handle_call({cas, {Key, Flag, ExpTime, CasUniq, Value}}, _From, Socket) ->
{reply, Reply, Socket}.
%% @private
+handle_cast(stop, State) ->
+ {stop, normal, State};
+
handle_cast(_Msg, State) -> {noreply, State}.
%% @private
Please sign in to comment.
Something went wrong with that request. Please try again.