diff --git a/lib/db_connection.ex b/lib/db_connection.ex index 60d4c4c..10e27a0 100644 --- a/lib/db_connection.ex +++ b/lib/db_connection.ex @@ -362,6 +362,15 @@ defmodule DBConnection do """ @callback disconnect(err :: Exception.t(), state :: any) :: :ok + @doc """ + Optional callback for handling messages received by the connection. + + Returns `{:disconnect, exception}` to close the connection or `:ok` to continue. + """ + @callback handle_info(message :: any, state :: any) :: {:disconnect, Exception.t()} | :ok + + @optional_callbacks handle_info: 2 + @connection_module_key :connection_module @doc """