Jacob Perkins avatar Jacob Perkins committed b91a6e0

vsn 0.1.5, handle when caller queue is empty

Comments (0)

Files changed (3)

 {application, erldis, [
 	{description, "Erlang Redis application"},
-	{vsn, "0.1.4"},
+	{vsn, "0.1.5"},
 	{registered, [erldis_sup]},
 	{mod, {erldis_app, []}},
 	{applications, [kernel, stdlib]},

ebin/erldis.appup

-{"0.1.4", [
+{"0.1.5", [
+	{"0.1.4", [{load_module, erldis_client}]},
 	{"0.1.3", [{load_module, erldis_client}]},
 	{"0.1.2", [{load_module, erldis_client}]},
 	{"0.1.1", [
 		{add_module, erldis_sets}
 	]}
 ], [
+	{"0.1.4", [{load_module, erldis_client}]},
 	{"0.1.3", [{load_module, erldis_client}]},
 	{"0.1.2", [{load_module, erldis_client}]},
 	{"0.1.1", [

src/erldis_client.erl

 		R -> R
 	end,
 	
-	{{value, _From}, Queue} = queue:out(Calls),
+	{_, Queue} = queue:out(Calls),
 	
 	case queue:len(Queue) of
 		0 ->
 	end;
 
 send_reply(State) ->
-	{{value, From}, Queue} = queue:out(State#redis.calls),
-	Reply = lists:reverse(State#redis.buffer),
-	gen_server2:reply(From, Reply),
+	case queue:out(State#redis.calls) of
+		{{value, From}, Queue} ->
+			Reply = lists:reverse(State#redis.buffer),
+			gen_server2:reply(From, Reply);
+		{empty, Queue} ->
+			ok
+	end,
+	
 	State#redis{calls=Queue, buffer=[], pstate=empty}.
 
-
 parse_state(State, Socket, Data) ->
 	Parse = erldis_proto:parse(State#redis.pstate, trim2(Data)),
 	
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.