diff --git a/src/pgsql_connection.erl b/src/pgsql_connection.erl index 81c3c17..d4986aa 100644 --- a/src/pgsql_connection.erl +++ b/src/pgsql_connection.erl @@ -640,11 +640,10 @@ encode_list(L) -> notify(#state{reply_to = {Pid, _Tag}}, Msg) -> Pid ! {pgsql, self(), Msg}. -notify_async(#state{async = Pid}, Msg) -> - case is_pid(Pid) of - true -> Pid ! {pgsql, self(), Msg}; - false -> false - end. +notify_async(#state{async = Server}, Msg) when is_pid(Server) orelse is_atom(Server) -> + Server ! {pgsql, self(), Msg}; +notify_async(#state{}, _Msg) -> + false. to_binary(B) when is_binary(B) -> B; to_binary(L) when is_list(L) -> list_to_binary(L).