Browse Source

reply to call owner

Anton Lebedevich 13 years ago
parent
commit
0be28cc1aa
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/pgsql_sock.erl

+ 5 - 0
src/pgsql_sock.erl

@@ -141,6 +141,11 @@ send(#state{mod = Mod, sock = Sock}, Data) ->
 send(#state{mod = Mod, sock = Sock}, Type, Data) ->
     Mod:send(Sock, pgsql_wire:encode(Type, Data)).
 
+reply(#state{queue = Q} = State, Message) ->
+    {{value, Pid}, Q2} = queue:out(Q),
+    Pid ! Message,
+    State#state{queue = Q2}.
+
 %% -- backend message handling --
 
 %% AuthenticationOk