Skip to content

Commit 4776530

Browse files
authored
Document handle_info/2 (#317)
1 parent 625b89f commit 4776530

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/db_connection.ex

+9
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,15 @@ defmodule DBConnection do
362362
"""
363363
@callback disconnect(err :: Exception.t(), state :: any) :: :ok
364364

365+
@doc """
366+
Optional callback for handling messages received by the connection.
367+
368+
Returns `{:disconnect, exception}` to close the connection or `:ok` to continue.
369+
"""
370+
@callback handle_info(message :: any, state :: any) :: {:disconnect, Exception.t()} | :ok
371+
372+
@optional_callbacks handle_info: 2
373+
365374
@connection_module_key :connection_module
366375

367376
@doc """

0 commit comments

Comments
 (0)